@affluent-org/sdk 0.0.1
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/.prettierrc +11 -0
- package/Refactoring.md +548 -0
- package/dist/_compiled/Account.compiled.json +1 -0
- package/dist/_compiled/Receipt.compiled.json +1 -0
- package/dist/_compiled/WTONWallet.compiled.json +1 -0
- package/dist/_compiled/index.d.ts +4 -0
- package/dist/_compiled/index.js +12 -0
- package/dist/affluent.d.ts +14 -0
- package/dist/affluent.js +20 -0
- package/dist/constants/constants.d.ts +2 -0
- package/dist/constants/constants.js +5 -0
- package/dist/constants/contracts.d.ts +9 -0
- package/dist/constants/contracts.js +18 -0
- package/dist/context.d.ts +43 -0
- package/dist/context.js +90 -0
- package/dist/contracts/common/type.d.ts +16 -0
- package/dist/contracts/common/type.js +2 -0
- package/dist/contracts/common/utils.d.ts +3 -0
- package/dist/contracts/common/utils.js +16 -0
- package/dist/contracts/core/account/index.d.ts +38 -0
- package/dist/contracts/core/account/index.js +128 -0
- package/dist/contracts/core/account/type.d.ts +18 -0
- package/dist/contracts/core/account/type.js +2 -0
- package/dist/contracts/core/pool/index.d.ts +149 -0
- package/dist/contracts/core/pool/index.js +379 -0
- package/dist/contracts/core/pool/serializer.d.ts +15 -0
- package/dist/contracts/core/pool/serializer.js +307 -0
- package/dist/contracts/core/pool/type.d.ts +136 -0
- package/dist/contracts/core/pool/type.js +2 -0
- package/dist/contracts/dedust-farm/MockDedustFarm.d.ts +41 -0
- package/dist/contracts/dedust-farm/MockDedustFarm.js +79 -0
- package/dist/contracts/external/tonstaker.d.ts +18 -0
- package/dist/contracts/external/tonstaker.js +26 -0
- package/dist/contracts/factory/factory.d.ts +24 -0
- package/dist/contracts/factory/factory.js +58 -0
- package/dist/contracts/factory/type.d.ts +11 -0
- package/dist/contracts/factory/type.js +2 -0
- package/dist/contracts/farm/distributor.d.ts +43 -0
- package/dist/contracts/farm/distributor.js +83 -0
- package/dist/contracts/farm/receipt.d.ts +40 -0
- package/dist/contracts/farm/receipt.js +68 -0
- package/dist/contracts/irm/jump-irm/serializer.d.ts +4 -0
- package/dist/contracts/irm/jump-irm/serializer.js +26 -0
- package/dist/contracts/irm/jump-irm/type.d.ts +8 -0
- package/dist/contracts/irm/jump-irm/type.js +2 -0
- package/dist/contracts/jetton/jetton-minter.d.ts +23 -0
- package/dist/contracts/jetton/jetton-minter.js +46 -0
- package/dist/contracts/jetton/jetton-wallet.d.ts +67 -0
- package/dist/contracts/jetton/jetton-wallet.js +119 -0
- package/dist/contracts/jetton/type.d.ts +7 -0
- package/dist/contracts/jetton/type.js +2 -0
- package/dist/contracts/liquid_token/dedust/minter.d.ts +56 -0
- package/dist/contracts/liquid_token/dedust/minter.js +112 -0
- package/dist/contracts/liquid_token/dedust/wallet.d.ts +127 -0
- package/dist/contracts/liquid_token/dedust/wallet.js +213 -0
- package/dist/contracts/liquid_token/stonfi/LFStonfiJettonMinter.d.ts +53 -0
- package/dist/contracts/liquid_token/stonfi/LFStonfiJettonMinter.js +110 -0
- package/dist/contracts/liquid_token/stonfi/LFStonfiJettonWallet.d.ts +169 -0
- package/dist/contracts/liquid_token/stonfi/LFStonfiJettonWallet.js +288 -0
- package/dist/contracts/oracle/composite-onchain-oracle/index.d.ts +108 -0
- package/dist/contracts/oracle/composite-onchain-oracle/index.js +185 -0
- package/dist/contracts/oracle/parser.d.ts +7 -0
- package/dist/contracts/oracle/parser.js +77 -0
- package/dist/contracts/oracle/redstone-onchain-oracle/index.d.ts +56 -0
- package/dist/contracts/oracle/redstone-onchain-oracle/index.js +159 -0
- package/dist/contracts/oracle/redstone-onchain-oracle/serializer.d.ts +4 -0
- package/dist/contracts/oracle/redstone-onchain-oracle/serializer.js +137 -0
- package/dist/contracts/oracle/redstone-onchain-oracle/type.d.ts +57 -0
- package/dist/contracts/oracle/redstone-onchain-oracle/type.js +18 -0
- package/dist/contracts/oracle/redstone-oracle/serializer.d.ts +3 -0
- package/dist/contracts/oracle/redstone-oracle/serializer.js +30 -0
- package/dist/contracts/oracle/redstone-oracle/type.d.ts +9 -0
- package/dist/contracts/oracle/redstone-oracle/type.js +2 -0
- package/dist/contracts/oracle/redstone-parser.d.ts +9 -0
- package/dist/contracts/oracle/redstone-parser.js +58 -0
- package/dist/contracts/rfq/rfq_auction/index.d.ts +216 -0
- package/dist/contracts/rfq/rfq_auction/index.js +334 -0
- package/dist/contracts/rfq/rfq_batch/index.d.ts +346 -0
- package/dist/contracts/rfq/rfq_batch/index.js +448 -0
- package/dist/contracts/rfq/rfq_event_emitter/index.d.ts +132 -0
- package/dist/contracts/rfq/rfq_event_emitter/index.js +143 -0
- package/dist/contracts/stonfi-farm/MockStonfiFarmItem.d.ts +41 -0
- package/dist/contracts/stonfi-farm/MockStonfiFarmItem.js +83 -0
- package/dist/contracts/stonfi-farm/MockStonfiFarmMinter.d.ts +45 -0
- package/dist/contracts/stonfi-farm/MockStonfiFarmMinter.js +92 -0
- package/dist/contracts/unknown-contract/index.d.ts +14 -0
- package/dist/contracts/unknown-contract/index.js +18 -0
- package/dist/contracts/vault/share-vault/index.d.ts +206 -0
- package/dist/contracts/vault/share-vault/index.js +373 -0
- package/dist/contracts/vault/strategy-vault/codec.d.ts +710 -0
- package/dist/contracts/vault/strategy-vault/codec.js +1256 -0
- package/dist/contracts/vault/strategy-vault/computation.d.ts +11 -0
- package/dist/contracts/vault/strategy-vault/computation.js +56 -0
- package/dist/contracts/vault/strategy-vault/constants.d.ts +163 -0
- package/dist/contracts/vault/strategy-vault/constants.js +170 -0
- package/dist/contracts/vault/strategy-vault/index.d.ts +587 -0
- package/dist/contracts/vault/strategy-vault/index.js +406 -0
- package/dist/contracts/vault/strategy-vault/type.d.ts +115 -0
- package/dist/contracts/vault/strategy-vault/type.js +2 -0
- package/dist/contracts/wton/jetton-minter.d.ts +35 -0
- package/dist/contracts/wton/jetton-minter.js +71 -0
- package/dist/contracts/wton/jetton-wallet.d.ts +90 -0
- package/dist/contracts/wton/jetton-wallet.js +153 -0
- package/dist/contracts/wton/type.d.ts +7 -0
- package/dist/contracts/wton/type.js +2 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.js +65 -0
- package/dist/lib/assert.d.ts +1 -0
- package/dist/lib/assert.js +9 -0
- package/dist/lib/query-cache.d.ts +5 -0
- package/dist/lib/query-cache.js +57 -0
- package/dist/lib/send-msg.d.ts +11 -0
- package/dist/lib/send-msg.js +9 -0
- package/dist/services/composite-oracle/computation.d.ts +55 -0
- package/dist/services/composite-oracle/computation.js +295 -0
- package/dist/services/composite-oracle/index.d.ts +45 -0
- package/dist/services/composite-oracle/index.js +110 -0
- package/dist/services/composite-oracle/query.d.ts +36 -0
- package/dist/services/composite-oracle/query.js +251 -0
- package/dist/services/composite-oracle/types.d.ts +82 -0
- package/dist/services/composite-oracle/types.js +11 -0
- package/dist/services/pool/computation.d.ts +75 -0
- package/dist/services/pool/computation.js +219 -0
- package/dist/services/pool/index.d.ts +94 -0
- package/dist/services/pool/index.js +139 -0
- package/dist/services/pool/oracle.d.ts +20 -0
- package/dist/services/pool/oracle.js +61 -0
- package/dist/services/pool/owner/index.d.ts +37 -0
- package/dist/services/pool/owner/index.js +76 -0
- package/dist/services/pool/owner/types.d.ts +18 -0
- package/dist/services/pool/owner/types.js +2 -0
- package/dist/services/pool/query.d.ts +64 -0
- package/dist/services/pool/query.js +282 -0
- package/dist/services/pool/user/index.d.ts +86 -0
- package/dist/services/pool/user/index.js +285 -0
- package/dist/services/pool/user/types.d.ts +44 -0
- package/dist/services/pool/user/types.js +2 -0
- package/dist/services/rfq-auction/index.d.ts +81 -0
- package/dist/services/rfq-auction/index.js +93 -0
- package/dist/services/rfq-auction/oracle.d.ts +19 -0
- package/dist/services/rfq-auction/oracle.js +60 -0
- package/dist/services/rfq-auction/query.d.ts +50 -0
- package/dist/services/rfq-auction/query.js +19 -0
- package/dist/services/rfq-auction/user/index.d.ts +63 -0
- package/dist/services/rfq-auction/user/index.js +218 -0
- package/dist/services/rfq-auction/user/types.d.ts +29 -0
- package/dist/services/rfq-auction/user/types.js +2 -0
- package/dist/services/rfq-batch/index.d.ts +78 -0
- package/dist/services/rfq-batch/index.js +132 -0
- package/dist/services/rfq-batch/oracle.d.ts +22 -0
- package/dist/services/rfq-batch/oracle.js +54 -0
- package/dist/services/rfq-batch/query.d.ts +46 -0
- package/dist/services/rfq-batch/query.js +34 -0
- package/dist/services/rfq-batch/user/index.d.ts +79 -0
- package/dist/services/rfq-batch/user/index.js +171 -0
- package/dist/services/rfq-batch/user/types.d.ts +37 -0
- package/dist/services/rfq-batch/user/types.js +2 -0
- package/dist/services/share-vault/computation.d.ts +24 -0
- package/dist/services/share-vault/computation.js +42 -0
- package/dist/services/share-vault/index.d.ts +90 -0
- package/dist/services/share-vault/index.js +128 -0
- package/dist/services/share-vault/manager/index.d.ts +40 -0
- package/dist/services/share-vault/manager/index.js +111 -0
- package/dist/services/share-vault/manager/types.d.ts +23 -0
- package/dist/services/share-vault/manager/types.js +2 -0
- package/dist/services/share-vault/owner/index.d.ts +64 -0
- package/dist/services/share-vault/owner/index.js +122 -0
- package/dist/services/share-vault/owner/types.d.ts +33 -0
- package/dist/services/share-vault/owner/types.js +2 -0
- package/dist/services/share-vault/query.d.ts +34 -0
- package/dist/services/share-vault/query.js +138 -0
- package/dist/services/share-vault/user/index.d.ts +33 -0
- package/dist/services/share-vault/user/index.js +106 -0
- package/dist/services/share-vault/user/types.d.ts +13 -0
- package/dist/services/share-vault/user/types.js +2 -0
- package/dist/services/strategy-vault/index.d.ts +2124 -0
- package/dist/services/strategy-vault/index.js +268 -0
- package/dist/services/strategy-vault/manager/index.d.ts +1968 -0
- package/dist/services/strategy-vault/manager/index.js +475 -0
- package/dist/services/strategy-vault/manager/types.d.ts +144 -0
- package/dist/services/strategy-vault/manager/types.js +2 -0
- package/dist/services/strategy-vault/oracle.d.ts +66 -0
- package/dist/services/strategy-vault/oracle.js +162 -0
- package/dist/services/strategy-vault/owner/index.d.ts +277 -0
- package/dist/services/strategy-vault/owner/index.js +333 -0
- package/dist/services/strategy-vault/owner/types.d.ts +146 -0
- package/dist/services/strategy-vault/owner/types.js +2 -0
- package/dist/services/strategy-vault/query.d.ts +138 -0
- package/dist/services/strategy-vault/query.js +59 -0
- package/dist/services/strategy-vault/user/index.d.ts +89 -0
- package/dist/services/strategy-vault/user/index.js +219 -0
- package/dist/services/strategy-vault/user/types.d.ts +46 -0
- package/dist/services/strategy-vault/user/types.js +2 -0
- package/dist/types/sender.d.ts +7 -0
- package/dist/types/sender.js +2 -0
- package/dist/utils/action-parser.d.ts +7 -0
- package/dist/utils/action-parser.js +20 -0
- package/dist/utils/external-message-hash.d.ts +45 -0
- package/dist/utils/external-message-hash.js +65 -0
- package/dist/utils/oracle/redstone/readonlyCachedRedstone.d.ts +3 -0
- package/dist/utils/oracle/redstone/readonlyCachedRedstone.js +25 -0
- package/dist/utils/oracle/redstone/redstoneHelper.d.ts +21 -0
- package/dist/utils/oracle/redstone/redstoneHelper.js +228 -0
- package/dist/utils/parser.d.ts +40 -0
- package/dist/utils/parser.js +580 -0
- package/dist/utils/pending-tracker/index.d.ts +14 -0
- package/dist/utils/pending-tracker/index.js +34 -0
- package/dist/utils/pending-tracker/trackable-sender.d.ts +16 -0
- package/dist/utils/pending-tracker/trackable-sender.js +87 -0
- package/dist/utils/pending-tracker/type.d.ts +78 -0
- package/dist/utils/pending-tracker/type.js +2 -0
- package/dist/utils/pending-tracker/v3-client.d.ts +31 -0
- package/dist/utils/pending-tracker/v3-client.js +104 -0
- package/dist/utils/risk_calculator/risk_calculator.d.ts +45 -0
- package/dist/utils/risk_calculator/risk_calculator.js +332 -0
- package/dist/utils/utils.d.ts +5 -0
- package/dist/utils/utils.js +12 -0
- package/package.json +46 -0
|
@@ -0,0 +1,1256 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DictionaryValues = void 0;
|
|
4
|
+
exports.strategyVaultConfigToCell = strategyVaultConfigToCell;
|
|
5
|
+
exports.strategyVaultConfigToCellV1 = strategyVaultConfigToCellV1;
|
|
6
|
+
exports.strategyVaultConfigToCellV2 = strategyVaultConfigToCellV2;
|
|
7
|
+
exports.parseVaultData = parseVaultData;
|
|
8
|
+
exports.parseVaultDataV1 = parseVaultDataV1;
|
|
9
|
+
exports.parseVaultDataV2 = parseVaultDataV2;
|
|
10
|
+
exports.parseRFQConfig = parseRFQConfig;
|
|
11
|
+
exports.parseGasConfig = parseGasConfig;
|
|
12
|
+
exports.parseXChainOftConfig = parseXChainOftConfig;
|
|
13
|
+
exports.parseXChainStrategyConfig = parseXChainStrategyConfig;
|
|
14
|
+
exports.createRFQConfig = createRFQConfig;
|
|
15
|
+
exports.getOpName = getOpName;
|
|
16
|
+
exports.getErrorName = getErrorName;
|
|
17
|
+
exports.createInteractiveVaultDict = createInteractiveVaultDict;
|
|
18
|
+
exports.createSetTimelockMsgBody = createSetTimelockMsgBody;
|
|
19
|
+
exports.createExecuteOwnerActionMsgBody = createExecuteOwnerActionMsgBody;
|
|
20
|
+
exports.createRevertOwnerActionMsgBody = createRevertOwnerActionMsgBody;
|
|
21
|
+
exports.parseSetTimelockMsgBody = parseSetTimelockMsgBody;
|
|
22
|
+
exports.parseExecuteOwnerActionMsgBody = parseExecuteOwnerActionMsgBody;
|
|
23
|
+
exports.parseRevertOwnerActionMsgBody = parseRevertOwnerActionMsgBody;
|
|
24
|
+
exports.createSetProtocolFeeRatePerYearMsgBody = createSetProtocolFeeRatePerYearMsgBody;
|
|
25
|
+
exports.createSetProtocolFeeManagerAddressMsgBody = createSetProtocolFeeManagerAddressMsgBody;
|
|
26
|
+
exports.createClaimProtocolFeeMsgBody = createClaimProtocolFeeMsgBody;
|
|
27
|
+
exports.createSetManagementFeeRatePerYearMsgBody = createSetManagementFeeRatePerYearMsgBody;
|
|
28
|
+
exports.createSetManagementFeeRecipientAddressMsgBody = createSetManagementFeeRecipientAddressMsgBody;
|
|
29
|
+
exports.createClaimManagementFeeMsgBody = createClaimManagementFeeMsgBody;
|
|
30
|
+
exports.parseSetProtocolFeeRatePerYearMsgBody = parseSetProtocolFeeRatePerYearMsgBody;
|
|
31
|
+
exports.parseSetProtocolFeeManagerAddressMsgBody = parseSetProtocolFeeManagerAddressMsgBody;
|
|
32
|
+
exports.parseClaimProtocolFeeMsgBody = parseClaimProtocolFeeMsgBody;
|
|
33
|
+
exports.parseSetManagementFeeRatePerYearMsgBody = parseSetManagementFeeRatePerYearMsgBody;
|
|
34
|
+
exports.parseSetManagementFeeRecipientAddressMsgBody = parseSetManagementFeeRecipientAddressMsgBody;
|
|
35
|
+
exports.parseClaimManagementFeeMsgBody = parseClaimManagementFeeMsgBody;
|
|
36
|
+
exports.createSetWalletCodeMsgBody = createSetWalletCodeMsgBody;
|
|
37
|
+
exports.createSetDataAggregatorCodeMsgBody = createSetDataAggregatorCodeMsgBody;
|
|
38
|
+
exports.createSetRFQCodeMsgBody = createSetRFQCodeMsgBody;
|
|
39
|
+
exports.createUpgradeCodeMsgBody = createUpgradeCodeMsgBody;
|
|
40
|
+
exports.createSetContentMsgBody = createSetContentMsgBody;
|
|
41
|
+
exports.parseSetWalletCodeMsgBody = parseSetWalletCodeMsgBody;
|
|
42
|
+
exports.parseSetDataAggregatorCodeMsgBody = parseSetDataAggregatorCodeMsgBody;
|
|
43
|
+
exports.parseSetRFQCodeMsgBody = parseSetRFQCodeMsgBody;
|
|
44
|
+
exports.parseUpgradeCodeMsgBody = parseUpgradeCodeMsgBody;
|
|
45
|
+
exports.parseSetContentMsgBody = parseSetContentMsgBody;
|
|
46
|
+
exports.createSetOwnerAddressMsgBody = createSetOwnerAddressMsgBody;
|
|
47
|
+
exports.createSetGuardianAddressMsgBody = createSetGuardianAddressMsgBody;
|
|
48
|
+
exports.createSetManagerAddressMsgBody = createSetManagerAddressMsgBody;
|
|
49
|
+
exports.parseSetOwnerAddressMsgBody = parseSetOwnerAddressMsgBody;
|
|
50
|
+
exports.parseSetGuardianAddressMsgBody = parseSetGuardianAddressMsgBody;
|
|
51
|
+
exports.parseSetManagerAddressMsgBody = parseSetManagerAddressMsgBody;
|
|
52
|
+
exports.createSetAssetConfigMsgBody = createSetAssetConfigMsgBody;
|
|
53
|
+
exports.createSetAssetConfigV2MsgBody = createSetAssetConfigV2MsgBody;
|
|
54
|
+
exports.parseSetAssetConfigMsgBody = parseSetAssetConfigMsgBody;
|
|
55
|
+
exports.createSetFactorialPoolConfigMsgBody = createSetFactorialPoolConfigMsgBody;
|
|
56
|
+
exports.parseSetFactorialPoolConfigMsgBody = parseSetFactorialPoolConfigMsgBody;
|
|
57
|
+
exports.createSetRFQConfigMsgBody = createSetRFQConfigMsgBody;
|
|
58
|
+
exports.parseSetRFQConfigMsgBody = parseSetRFQConfigMsgBody;
|
|
59
|
+
exports.createSetOracleConfigMsgBody = createSetOracleConfigMsgBody;
|
|
60
|
+
exports.parseSetOracleConfigMsgBody = parseSetOracleConfigMsgBody;
|
|
61
|
+
exports.createSetGasConfigMsgBody = createSetGasConfigMsgBody;
|
|
62
|
+
exports.parseSetGasConfigMsgBody = parseSetGasConfigMsgBody;
|
|
63
|
+
exports.createSetPrivateVaultMsgBody = createSetPrivateVaultMsgBody;
|
|
64
|
+
exports.createSetWhitelistedMintersMsgBody = createSetWhitelistedMintersMsgBody;
|
|
65
|
+
exports.parseSetPrivateVaultMsgBody = parseSetPrivateVaultMsgBody;
|
|
66
|
+
exports.parseSetWhitelistedMintersMsgBody = parseSetWhitelistedMintersMsgBody;
|
|
67
|
+
exports.createSetMaxLeverageRatioMsgBody = createSetMaxLeverageRatioMsgBody;
|
|
68
|
+
exports.createSetGlobalDepositValueCapMsgBody = createSetGlobalDepositValueCapMsgBody;
|
|
69
|
+
exports.createSetDepositCloseTimestampMsgBody = createSetDepositCloseTimestampMsgBody;
|
|
70
|
+
exports.createSetWithdrawOpenTimestampMsgBody = createSetWithdrawOpenTimestampMsgBody;
|
|
71
|
+
exports.createSetWithdrawFeeRateMsgBody = createSetWithdrawFeeRateMsgBody;
|
|
72
|
+
exports.createSetQueueWithdrawFeeRateMsgBody = createSetQueueWithdrawFeeRateMsgBody;
|
|
73
|
+
exports.parseSetMaxLeverageRatioMsgBody = parseSetMaxLeverageRatioMsgBody;
|
|
74
|
+
exports.parseSetDepositCloseTimestampMsgBody = parseSetDepositCloseTimestampMsgBody;
|
|
75
|
+
exports.parseSetWithdrawOpenTimestampMsgBody = parseSetWithdrawOpenTimestampMsgBody;
|
|
76
|
+
exports.createSetXChainConnectorAddressMsgBody = createSetXChainConnectorAddressMsgBody;
|
|
77
|
+
exports.createSetXChainConfigMsgBody = createSetXChainConfigMsgBody;
|
|
78
|
+
exports.createRequestEidConnectionMsgBody = createRequestEidConnectionMsgBody;
|
|
79
|
+
exports.createSetInteractiveVaultConfigMsgBody = createSetInteractiveVaultConfigMsgBody;
|
|
80
|
+
exports.createInitializeMsgBody = createInitializeMsgBody;
|
|
81
|
+
exports.createExecuteStrategyMsgBody = createExecuteStrategyMsgBody;
|
|
82
|
+
exports.parseInitializeMsgBody = parseInitializeMsgBody;
|
|
83
|
+
exports.parseExecuteStrategyMsgBody = parseExecuteStrategyMsgBody;
|
|
84
|
+
exports.createSupplyToFactorialMsgBody = createSupplyToFactorialMsgBody;
|
|
85
|
+
exports.createWithdrawFromFactorialMsgBody = createWithdrawFromFactorialMsgBody;
|
|
86
|
+
exports.createBorrowFromFactorialMsgBody = createBorrowFromFactorialMsgBody;
|
|
87
|
+
exports.createRepayToFactorialMsgBody = createRepayToFactorialMsgBody;
|
|
88
|
+
exports.createLiquidateToFactorialMsgBody = createLiquidateToFactorialMsgBody;
|
|
89
|
+
exports.parseSupplyToFactorialMsgBody = parseSupplyToFactorialMsgBody;
|
|
90
|
+
exports.parseWithdrawFromFactorialMsgBody = parseWithdrawFromFactorialMsgBody;
|
|
91
|
+
exports.parseBorrowFromFactorialMsgBody = parseBorrowFromFactorialMsgBody;
|
|
92
|
+
exports.parseRepayToFactorialMsgBody = parseRepayToFactorialMsgBody;
|
|
93
|
+
exports.parseLiquidateToFactorialMsgBody = parseLiquidateToFactorialMsgBody;
|
|
94
|
+
exports.createCreateRFQMsgBody = createCreateRFQMsgBody;
|
|
95
|
+
exports.createCancelRFQMsgBody = createCancelRFQMsgBody;
|
|
96
|
+
exports.parseCreateRFQMsgBody = parseCreateRFQMsgBody;
|
|
97
|
+
exports.parseCancelRFQMsgBody = parseCancelRFQMsgBody;
|
|
98
|
+
exports.createDepositEidMsgBody = createDepositEidMsgBody;
|
|
99
|
+
exports.createWithdrawEidMsgBody = createWithdrawEidMsgBody;
|
|
100
|
+
exports.createExecuteXChainStrategyMsgBody = createExecuteXChainStrategyMsgBody;
|
|
101
|
+
exports.createExecuteXChainStrategyNoValidationMsgBody = createExecuteXChainStrategyNoValidationMsgBody;
|
|
102
|
+
exports.createConfirmXChainUpdateMsgBody = createConfirmXChainUpdateMsgBody;
|
|
103
|
+
exports.createXChainNotificationMsgBody = createXChainNotificationMsgBody;
|
|
104
|
+
exports.createTransferToXChainAccountMsgBody = createTransferToXChainAccountMsgBody;
|
|
105
|
+
exports.createExecuteXChainStrategyPayload = createExecuteXChainStrategyPayload;
|
|
106
|
+
exports.createDepositToVaultMsgBody = createDepositToVaultMsgBody;
|
|
107
|
+
exports.createWithdrawFromVaultMsgBody = createWithdrawFromVaultMsgBody;
|
|
108
|
+
exports.createDepositToVaultQueueMsgBody = createDepositToVaultQueueMsgBody;
|
|
109
|
+
exports.createWithdrawFromVaultQueueMsgBody = createWithdrawFromVaultQueueMsgBody;
|
|
110
|
+
exports.createCancelDepositToVaultQueueMsgBody = createCancelDepositToVaultQueueMsgBody;
|
|
111
|
+
exports.createCancelWithdrawFromVaultQueueMsgBody = createCancelWithdrawFromVaultQueueMsgBody;
|
|
112
|
+
exports.createConfirmQueueMsgBody = createConfirmQueueMsgBody;
|
|
113
|
+
exports.createExecuteDepositQueueMsgBody = createExecuteDepositQueueMsgBody;
|
|
114
|
+
exports.createExecuteWithdrawQueueMsgBody = createExecuteWithdrawQueueMsgBody;
|
|
115
|
+
exports.parseExecuteDepositQueueMsgBody = parseExecuteDepositQueueMsgBody;
|
|
116
|
+
exports.parseExecuteWithdrawQueueMsgBody = parseExecuteWithdrawQueueMsgBody;
|
|
117
|
+
exports.parseConfirmQueueLog = parseConfirmQueueLog;
|
|
118
|
+
exports.parseQueueBatchExecuteLog = parseQueueBatchExecuteLog;
|
|
119
|
+
exports.createDepositPayloadV1 = createDepositPayloadV1;
|
|
120
|
+
exports.createDepositPayload = createDepositPayload;
|
|
121
|
+
exports.createDepositQueuePayload = createDepositQueuePayload;
|
|
122
|
+
exports.createWithdrawPayload = createWithdrawPayload;
|
|
123
|
+
exports.createWithdrawQueuePayload = createWithdrawQueuePayload;
|
|
124
|
+
exports.createCancelDepositQueueMsgBody = createCancelDepositQueueMsgBody;
|
|
125
|
+
exports.createCancelWithdrawQueueMsgBody = createCancelWithdrawQueueMsgBody;
|
|
126
|
+
exports.parseCancelDepositQueueMsgBody = parseCancelDepositQueueMsgBody;
|
|
127
|
+
exports.parseCancelWithdrawQueueMsgBody = parseCancelWithdrawQueueMsgBody;
|
|
128
|
+
exports.parseDepositQueueMsgBody = parseDepositQueueMsgBody;
|
|
129
|
+
exports.parseWithdrawQueueMsgBody = parseWithdrawQueueMsgBody;
|
|
130
|
+
exports.parseUserQueueLog = parseUserQueueLog;
|
|
131
|
+
const core_1 = require("@ton/core");
|
|
132
|
+
const constants_1 = require("./constants");
|
|
133
|
+
const parser_1 = require("../../oracle/parser");
|
|
134
|
+
// ============================================================================
|
|
135
|
+
//#region Dictionary Values
|
|
136
|
+
// ============================================================================
|
|
137
|
+
exports.DictionaryValues = {
|
|
138
|
+
AssetV1: () => ({
|
|
139
|
+
serialize: (src, builder) => {
|
|
140
|
+
return builder
|
|
141
|
+
.storeCoins(src.cash)
|
|
142
|
+
.storeCoins(src.balance)
|
|
143
|
+
.storeUint(src.isWhitelisted ? 1 : 0, 1)
|
|
144
|
+
.storeUint(src.isDepositable ? 1 : 0, 1)
|
|
145
|
+
.storeUint(src.isWithdrawable ? 1 : 0, 1)
|
|
146
|
+
.storeUint(src.exposureCap, 20);
|
|
147
|
+
},
|
|
148
|
+
parse: (src) => {
|
|
149
|
+
const cash = src.loadCoins();
|
|
150
|
+
const balance = src.loadCoins();
|
|
151
|
+
const isWhitelisted = src.loadBoolean();
|
|
152
|
+
const isDepositable = src.loadBoolean();
|
|
153
|
+
const isWithdrawable = src.loadBoolean();
|
|
154
|
+
const exposureCap = src.loadUint(20);
|
|
155
|
+
return {
|
|
156
|
+
isWhitelisted,
|
|
157
|
+
isDepositable,
|
|
158
|
+
isWithdrawable,
|
|
159
|
+
exposureCap,
|
|
160
|
+
cash,
|
|
161
|
+
balance,
|
|
162
|
+
};
|
|
163
|
+
},
|
|
164
|
+
}),
|
|
165
|
+
AssetV2: () => ({
|
|
166
|
+
serialize: (src, builder) => {
|
|
167
|
+
return builder
|
|
168
|
+
.storeCoins(src.cash)
|
|
169
|
+
.storeCoins(src.balance)
|
|
170
|
+
.storeUint(src.isWhitelisted ? 1 : 0, 1)
|
|
171
|
+
.storeUint(src.isDepositable ? 1 : 0, 1)
|
|
172
|
+
.storeUint(src.isWithdrawable ? 1 : 0, 1)
|
|
173
|
+
.storeUint(src.isDepositQueueActivated ? 1 : 0, 1)
|
|
174
|
+
.storeUint(src.isWithdrawQueueActivated ? 1 : 0, 1)
|
|
175
|
+
.storeUint(src.exposureCap, 20);
|
|
176
|
+
},
|
|
177
|
+
parse: (src) => {
|
|
178
|
+
const cash = src.loadCoins();
|
|
179
|
+
const balance = src.loadCoins();
|
|
180
|
+
const isWhitelisted = src.loadBoolean();
|
|
181
|
+
const isDepositable = src.loadBoolean();
|
|
182
|
+
const isWithdrawable = src.loadBoolean();
|
|
183
|
+
const isDepositQueueActivated = src.loadBoolean();
|
|
184
|
+
const isWithdrawQueueActivated = src.loadBoolean();
|
|
185
|
+
const exposureCap = src.loadUint(20);
|
|
186
|
+
return {
|
|
187
|
+
isWhitelisted,
|
|
188
|
+
isDepositable,
|
|
189
|
+
isWithdrawable,
|
|
190
|
+
isDepositQueueActivated,
|
|
191
|
+
isWithdrawQueueActivated,
|
|
192
|
+
exposureCap,
|
|
193
|
+
cash,
|
|
194
|
+
balance,
|
|
195
|
+
};
|
|
196
|
+
},
|
|
197
|
+
}),
|
|
198
|
+
FactorialPool: () => ({
|
|
199
|
+
serialize: (src, builder) => {
|
|
200
|
+
const _assets = core_1.Dictionary.empty(core_1.Dictionary.Keys.Address(), exports.DictionaryValues.FactorialPoolAsset());
|
|
201
|
+
Object.keys(src).forEach((key) => {
|
|
202
|
+
_assets.set(core_1.Address.parse(key), src[key]);
|
|
203
|
+
});
|
|
204
|
+
return builder.storeDict(_assets);
|
|
205
|
+
},
|
|
206
|
+
parse: (src) => {
|
|
207
|
+
const _assets = src.loadDict(core_1.Dictionary.Keys.Address(), exports.DictionaryValues.FactorialPoolAsset());
|
|
208
|
+
const assets = {};
|
|
209
|
+
for (const key of _assets.keys()) {
|
|
210
|
+
assets[key.toString()] = _assets.get(key);
|
|
211
|
+
}
|
|
212
|
+
return assets;
|
|
213
|
+
},
|
|
214
|
+
}),
|
|
215
|
+
FactorialPoolAsset: () => ({
|
|
216
|
+
serialize: (src, builder) => {
|
|
217
|
+
return builder
|
|
218
|
+
.storeCoins(src.supply)
|
|
219
|
+
.storeCoins(src.borrow)
|
|
220
|
+
.storeBit(src.isSupplyable)
|
|
221
|
+
.storeBit(src.isBorrowable);
|
|
222
|
+
},
|
|
223
|
+
parse: (src) => {
|
|
224
|
+
const supply = src.loadCoins();
|
|
225
|
+
const borrow = src.loadCoins();
|
|
226
|
+
const isSupplyable = src.loadBoolean();
|
|
227
|
+
const isBorrowable = src.loadBoolean();
|
|
228
|
+
return { supply, borrow, isSupplyable, isBorrowable };
|
|
229
|
+
},
|
|
230
|
+
}),
|
|
231
|
+
UpdateFactorialPool: () => ({
|
|
232
|
+
serialize: (src, builder) => {
|
|
233
|
+
const _assets = core_1.Dictionary.empty(core_1.Dictionary.Keys.Address(), exports.DictionaryValues.UpdateFactorialPoolAsset());
|
|
234
|
+
Object.keys(src).forEach((key) => {
|
|
235
|
+
_assets.set(core_1.Address.parse(key), src[key]);
|
|
236
|
+
});
|
|
237
|
+
return builder.storeDict(_assets);
|
|
238
|
+
},
|
|
239
|
+
parse: (src) => {
|
|
240
|
+
const _assets = src.loadDict(core_1.Dictionary.Keys.Address(), exports.DictionaryValues.UpdateFactorialPoolAsset());
|
|
241
|
+
const assets = {};
|
|
242
|
+
for (const key of _assets.keys()) {
|
|
243
|
+
assets[key.toString()] = _assets.get(key);
|
|
244
|
+
}
|
|
245
|
+
return assets;
|
|
246
|
+
},
|
|
247
|
+
}),
|
|
248
|
+
UpdateFactorialPoolAsset: () => ({
|
|
249
|
+
serialize: (src, builder) => {
|
|
250
|
+
return builder.storeBit(src.isSupplyable).storeBit(src.isBorrowable);
|
|
251
|
+
},
|
|
252
|
+
parse: (src) => {
|
|
253
|
+
const isSupplyable = src.loadBoolean();
|
|
254
|
+
const isBorrowable = src.loadBoolean();
|
|
255
|
+
return { isSupplyable, isBorrowable };
|
|
256
|
+
},
|
|
257
|
+
}),
|
|
258
|
+
Empty: () => ({
|
|
259
|
+
serialize: (_src, builder) => {
|
|
260
|
+
return builder;
|
|
261
|
+
},
|
|
262
|
+
parse: (_src) => {
|
|
263
|
+
return null;
|
|
264
|
+
},
|
|
265
|
+
}),
|
|
266
|
+
PendingOwnerAction: () => ({
|
|
267
|
+
serialize: (_src, _builder) => { },
|
|
268
|
+
parse: (src) => {
|
|
269
|
+
const timelock = src.loadCoins();
|
|
270
|
+
const op = src.loadUint(32);
|
|
271
|
+
const payloadHash = src.asCell().hash().toString("hex");
|
|
272
|
+
return { timelock, op, payloadHash };
|
|
273
|
+
},
|
|
274
|
+
}),
|
|
275
|
+
RequestQueueItem: () => ({
|
|
276
|
+
serialize: (src, builder) => {
|
|
277
|
+
return builder
|
|
278
|
+
.storeCoins(src.amount)
|
|
279
|
+
.storeAddress(src.responseAddress)
|
|
280
|
+
.storeCoins(src.jettonForwardTonAmount)
|
|
281
|
+
.storeMaybeRef(src.jettonForwardPayload)
|
|
282
|
+
.storeCoins(src.actionForwardTonAmount)
|
|
283
|
+
.storeMaybeRef(src.actionForwardPayload);
|
|
284
|
+
},
|
|
285
|
+
parse: (src) => {
|
|
286
|
+
return {
|
|
287
|
+
amount: src.loadCoins(),
|
|
288
|
+
responseAddress: src.loadAddress(),
|
|
289
|
+
jettonForwardTonAmount: src.loadCoins(),
|
|
290
|
+
jettonForwardPayload: src.loadMaybeRef(),
|
|
291
|
+
actionForwardTonAmount: src.loadCoins(),
|
|
292
|
+
actionForwardPayload: src.loadMaybeRef(),
|
|
293
|
+
};
|
|
294
|
+
},
|
|
295
|
+
}),
|
|
296
|
+
SumQueue: () => ({
|
|
297
|
+
serialize: (src, builder) => {
|
|
298
|
+
const itemsDict = Object.entries(src.dict).reduce((dict, [key, value]) => {
|
|
299
|
+
dict.set(core_1.Address.parse(key), value);
|
|
300
|
+
return dict;
|
|
301
|
+
}, core_1.Dictionary.empty(core_1.Dictionary.Keys.Address(), exports.DictionaryValues.RequestQueueItem()));
|
|
302
|
+
return builder
|
|
303
|
+
.storeCoins(src.queueId)
|
|
304
|
+
.storeCoins(src.sum)
|
|
305
|
+
.storeCoins(src.exchangeRate)
|
|
306
|
+
.storeDict(itemsDict, core_1.Dictionary.Keys.Address(), exports.DictionaryValues.RequestQueueItem());
|
|
307
|
+
},
|
|
308
|
+
parse: (src) => {
|
|
309
|
+
const queueId = src.loadCoins();
|
|
310
|
+
const sum = src.loadCoins();
|
|
311
|
+
const exchangeRate = src.loadCoins();
|
|
312
|
+
const dict = {};
|
|
313
|
+
for (const [key, value] of src.loadDict(core_1.Dictionary.Keys.Address(), exports.DictionaryValues.RequestQueueItem())) {
|
|
314
|
+
dict[key.toString()] = value;
|
|
315
|
+
}
|
|
316
|
+
return { queueId, sum, exchangeRate, dict };
|
|
317
|
+
},
|
|
318
|
+
}),
|
|
319
|
+
QueueManager: () => ({
|
|
320
|
+
serialize: (src, builder) => {
|
|
321
|
+
const pendingDict = Object.entries(src.pendingAssetQueue).reduce((dict, [key, value]) => {
|
|
322
|
+
dict.set(core_1.Address.parse(key), value);
|
|
323
|
+
return dict;
|
|
324
|
+
}, core_1.Dictionary.empty(core_1.Dictionary.Keys.Address(), exports.DictionaryValues.SumQueue()));
|
|
325
|
+
const confirmedDict = Object.entries(src.confirmedAssetQueue).reduce((dict, [key, value]) => {
|
|
326
|
+
dict.set(core_1.Address.parse(key), value);
|
|
327
|
+
return dict;
|
|
328
|
+
}, core_1.Dictionary.empty(core_1.Dictionary.Keys.Address(), exports.DictionaryValues.SumQueue()));
|
|
329
|
+
return builder
|
|
330
|
+
.storeCoins(src.totalSize)
|
|
331
|
+
.storeCoins(src.queueCounter)
|
|
332
|
+
.storeDict(pendingDict)
|
|
333
|
+
.storeDict(confirmedDict);
|
|
334
|
+
},
|
|
335
|
+
parse: (src) => {
|
|
336
|
+
const totalSize = src.loadCoins();
|
|
337
|
+
const queueCounter = src.loadCoins();
|
|
338
|
+
const pendingAssetQueue = {};
|
|
339
|
+
for (const [key, value] of src.loadDict(core_1.Dictionary.Keys.Address(), exports.DictionaryValues.SumQueue())) {
|
|
340
|
+
pendingAssetQueue[key.toString()] = value;
|
|
341
|
+
}
|
|
342
|
+
const confirmedAssetQueue = {};
|
|
343
|
+
for (const [key, value] of src.loadDict(core_1.Dictionary.Keys.Address(), exports.DictionaryValues.SumQueue())) {
|
|
344
|
+
confirmedAssetQueue[key.toString()] = value;
|
|
345
|
+
}
|
|
346
|
+
return { totalSize, queueCounter, pendingAssetQueue, confirmedAssetQueue };
|
|
347
|
+
},
|
|
348
|
+
}),
|
|
349
|
+
InteractiveVaultDict: () => ({
|
|
350
|
+
serialize: (src, builder) => {
|
|
351
|
+
const dict = core_1.Dictionary.empty(core_1.Dictionary.Keys.Address(), exports.DictionaryValues.InteractiveVaultConfig());
|
|
352
|
+
for (const [address, config] of Object.entries(src)) {
|
|
353
|
+
dict.set(core_1.Address.parse(address), config);
|
|
354
|
+
}
|
|
355
|
+
return builder.storeDict(dict);
|
|
356
|
+
},
|
|
357
|
+
parse: (src) => {
|
|
358
|
+
const dict = src.loadDictDirect(core_1.Dictionary.Keys.Address(), exports.DictionaryValues.InteractiveVaultConfig());
|
|
359
|
+
const result = {};
|
|
360
|
+
for (const key of dict.keys()) {
|
|
361
|
+
result[key.toString()] = dict.get(key);
|
|
362
|
+
}
|
|
363
|
+
return result;
|
|
364
|
+
},
|
|
365
|
+
}),
|
|
366
|
+
InteractiveVaultConfig: () => ({
|
|
367
|
+
serialize: (src, builder) => {
|
|
368
|
+
const addressDict = core_1.Dictionary.empty(core_1.Dictionary.Keys.Address(), exports.DictionaryValues.Empty());
|
|
369
|
+
if (src.supportedAssets) {
|
|
370
|
+
for (const assetAddress of src.supportedAssets) {
|
|
371
|
+
addressDict.set(core_1.Address.parse(assetAddress), null);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
return builder.storeUint(src.vaultType, 8).storeDict(addressDict);
|
|
375
|
+
},
|
|
376
|
+
parse: (src) => {
|
|
377
|
+
const vaultType = src.loadUint(8);
|
|
378
|
+
const addressDict = src.loadDict(core_1.Dictionary.Keys.Address(), exports.DictionaryValues.Empty());
|
|
379
|
+
const supportedAssets = [];
|
|
380
|
+
for (const key of addressDict.keys()) {
|
|
381
|
+
supportedAssets.push(key.toString());
|
|
382
|
+
}
|
|
383
|
+
return { vaultType, supportedAssets };
|
|
384
|
+
},
|
|
385
|
+
}),
|
|
386
|
+
XChainConfig: () => ({
|
|
387
|
+
serialize: (src, builder) => {
|
|
388
|
+
return builder
|
|
389
|
+
.storeBit(src.connected)
|
|
390
|
+
.storeUint(src.xchainAccountAddress, 256)
|
|
391
|
+
.storeMaybeRef(src.oftConfig)
|
|
392
|
+
.storeMaybeRef(src.strategyConfig)
|
|
393
|
+
.storeMaybeRef(src.afterStrategyConfig)
|
|
394
|
+
.storeCoins(src.lzGasFee);
|
|
395
|
+
},
|
|
396
|
+
parse: (src) => {
|
|
397
|
+
const connected = src.loadBoolean();
|
|
398
|
+
const xchainAccountAddress = src.loadUintBig(256);
|
|
399
|
+
const oftConfig = src.loadMaybeRef();
|
|
400
|
+
const strategyConfig = src.loadMaybeRef();
|
|
401
|
+
const afterStrategyConfig = src.loadMaybeRef();
|
|
402
|
+
const lzGasFee = src.loadCoins();
|
|
403
|
+
return { connected, xchainAccountAddress, oftConfig, strategyConfig, afterStrategyConfig, lzGasFee };
|
|
404
|
+
},
|
|
405
|
+
}),
|
|
406
|
+
XChainOftConfig: () => ({
|
|
407
|
+
serialize: (src, builder) => {
|
|
408
|
+
return builder
|
|
409
|
+
.storeAddress(src.destinationAddress)
|
|
410
|
+
.storeCoins(src.forwardGas)
|
|
411
|
+
.storeMaybeRef(src.forwardPayload)
|
|
412
|
+
.storeCoins(src.lzTransferFeeRate);
|
|
413
|
+
},
|
|
414
|
+
parse: (src) => {
|
|
415
|
+
const destinationAddress = src.loadAddress();
|
|
416
|
+
const forwardGas = src.loadCoins();
|
|
417
|
+
const forwardPayload = src.loadMaybeRef();
|
|
418
|
+
const lzTransferFeeRate = src.loadCoins();
|
|
419
|
+
return { destinationAddress, forwardGas, forwardPayload, lzTransferFeeRate };
|
|
420
|
+
},
|
|
421
|
+
}),
|
|
422
|
+
XChainStrategyConfig: () => ({
|
|
423
|
+
serialize: (src, builder) => {
|
|
424
|
+
return builder.storeBit(src.isExecutable);
|
|
425
|
+
},
|
|
426
|
+
parse: (src) => {
|
|
427
|
+
const isExecutable = src.loadBoolean();
|
|
428
|
+
return { isExecutable };
|
|
429
|
+
},
|
|
430
|
+
}),
|
|
431
|
+
};
|
|
432
|
+
//#endregion
|
|
433
|
+
// ============================================================================
|
|
434
|
+
//#region Storage - Config Serializers
|
|
435
|
+
// ============================================================================
|
|
436
|
+
function strategyVaultConfigToCell(config) {
|
|
437
|
+
return (0, core_1.beginCell)()
|
|
438
|
+
.storeRef(strategyVaultConfigToCellV1(config))
|
|
439
|
+
.storeRef(strategyVaultConfigToCellV2(config))
|
|
440
|
+
.endCell();
|
|
441
|
+
}
|
|
442
|
+
function strategyVaultConfigToCellV1(config) {
|
|
443
|
+
return (0, core_1.beginCell)()
|
|
444
|
+
.storeAddress(config.ownerAddress)
|
|
445
|
+
.storeMaybeRef(config.assets)
|
|
446
|
+
.storeMaybeRef(config.positions)
|
|
447
|
+
.storeCoins(config.aggregatorIndex)
|
|
448
|
+
.storeCoins(config.rfqIndex)
|
|
449
|
+
.storeCoins(config.totalSupply)
|
|
450
|
+
.storeCoins(config.collectedManagementFee)
|
|
451
|
+
.storeCoins(config.collectedProtocolFee)
|
|
452
|
+
.storeBit(config.isExecutingStrategy)
|
|
453
|
+
.storeRef((0, core_1.beginCell)()
|
|
454
|
+
.storeAddress(config.config.protocolFeeManagerAddress)
|
|
455
|
+
.storeAddress(config.config.managerAddress)
|
|
456
|
+
.storeBit(config.config.isPrivateVault)
|
|
457
|
+
.storeUint(config.config.depositCloseTimestamp, 40)
|
|
458
|
+
.storeUint(config.config.withdrawOpenTimestamp, 40)
|
|
459
|
+
.storeMaybeRef(config.config.whitelistedMinters)
|
|
460
|
+
.storeUint(config.config.lastCollectTime, 40)
|
|
461
|
+
.storeUint(config.config.managementFeeRate, 14)
|
|
462
|
+
.storeUint(config.config.protocolFeeRate, 14)
|
|
463
|
+
.storeUint(config.config.maxLeverageRatio, 20)
|
|
464
|
+
.storeMaybeRef(config.config.assetWalletDict)
|
|
465
|
+
.storeMaybeRef(config.config.walletAssetDict)
|
|
466
|
+
.storeRef((0, core_1.beginCell)()
|
|
467
|
+
.storeMaybeRef(config.config.rfqConfig)
|
|
468
|
+
.storeMaybeRef(config.config.gasConfig)
|
|
469
|
+
.storeMaybeRef(config.config.oracleConfig)
|
|
470
|
+
.storeAddress(config.config.managementFeeRecipientAddress)
|
|
471
|
+
.storeAddress(config.config.guardianAddress)
|
|
472
|
+
.storeCoins(config.config.timelock ?? 0n)
|
|
473
|
+
.storeCoins(0)
|
|
474
|
+
.storeCoins(0)
|
|
475
|
+
.storeMaybeRef(null)
|
|
476
|
+
.endCell())
|
|
477
|
+
.endCell())
|
|
478
|
+
.storeRef((0, core_1.beginCell)()
|
|
479
|
+
.storeRef(config.code.walletCode)
|
|
480
|
+
.storeRef(config.code.poolAggregatorCode)
|
|
481
|
+
.storeRef(config.code.rfqCode)
|
|
482
|
+
.storeRef(config.config.content)
|
|
483
|
+
.endCell())
|
|
484
|
+
.endCell();
|
|
485
|
+
}
|
|
486
|
+
function strategyVaultConfigToCellV2(config) {
|
|
487
|
+
return (0, core_1.beginCell)()
|
|
488
|
+
.storeRef((0, core_1.beginCell)()
|
|
489
|
+
.storeCoins(config.config.globalDepositValueCap)
|
|
490
|
+
.storeUint(config.config.withdrawFeeRate, 14)
|
|
491
|
+
.storeUint(config.config.queueWithdrawFeeRate ?? 0n, 14)
|
|
492
|
+
.storeRef((0, core_1.beginCell)()
|
|
493
|
+
.storeCoins(config.depositQueueManager?.totalSize ?? 0n)
|
|
494
|
+
.storeCoins(config.depositQueueManager?.queueCounter ?? 0n)
|
|
495
|
+
.storeMaybeRef(config.depositQueueManager?.pendingAssetQueueDict)
|
|
496
|
+
.storeMaybeRef(config.depositQueueManager?.confirmedAssetQueueDict)
|
|
497
|
+
.endCell())
|
|
498
|
+
.storeRef((0, core_1.beginCell)()
|
|
499
|
+
.storeCoins(config.withdrawQueueManager?.totalSize ?? 0n)
|
|
500
|
+
.storeCoins(config.withdrawQueueManager?.queueCounter ?? 0n)
|
|
501
|
+
.storeMaybeRef(config.withdrawQueueManager?.pendingAssetQueueDict)
|
|
502
|
+
.storeMaybeRef(config.withdrawQueueManager?.confirmedAssetQueueDict)
|
|
503
|
+
.endCell())
|
|
504
|
+
.storeMaybeRef(config.interactiveVaultDict)
|
|
505
|
+
.endCell())
|
|
506
|
+
.storeRef((0, core_1.beginCell)()
|
|
507
|
+
.storeAddress(config.config.crosschainConnectorAddress)
|
|
508
|
+
.storeMaybeRef(config.config.xchainConfig)
|
|
509
|
+
.storeUint(config.config.xchainUpdateHash ?? 0n, 256)
|
|
510
|
+
.endCell())
|
|
511
|
+
.endCell();
|
|
512
|
+
}
|
|
513
|
+
//#endregion
|
|
514
|
+
// ============================================================================
|
|
515
|
+
//#region Storage - Data Parsers
|
|
516
|
+
// ============================================================================
|
|
517
|
+
function parseVaultData(data) {
|
|
518
|
+
const slice = data.beginParse();
|
|
519
|
+
if (slice.remainingRefs == 2 && slice.remainingBits == 0) {
|
|
520
|
+
const v1 = parseVaultDataV1(slice.loadRef().beginParse());
|
|
521
|
+
const v2 = parseVaultDataV2(slice.loadRef().beginParse());
|
|
522
|
+
return { version: "v2", ...v1, ...v2 };
|
|
523
|
+
}
|
|
524
|
+
else {
|
|
525
|
+
const v1 = parseVaultDataV1(data.beginParse(), false);
|
|
526
|
+
return {
|
|
527
|
+
version: "v1",
|
|
528
|
+
...v1,
|
|
529
|
+
globalDepositValueCap: 0n,
|
|
530
|
+
withdrawFeeRate: 0,
|
|
531
|
+
queueWithdrawFeeRate: 0,
|
|
532
|
+
depositQueueManager: { totalSize: 0n, queueCounter: 0n, pendingAssetQueue: {}, confirmedAssetQueue: {} },
|
|
533
|
+
withdrawQueueManager: { totalSize: 0n, queueCounter: 0n, pendingAssetQueue: {}, confirmedAssetQueue: {} },
|
|
534
|
+
interactiveVaultDict: {},
|
|
535
|
+
xchainConnectorAddress: null,
|
|
536
|
+
xchainConfig: null,
|
|
537
|
+
xchainUpdateHash: 0n,
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
function parseVaultDataV1(data, isV2 = true) {
|
|
542
|
+
const owner = data.loadAddress();
|
|
543
|
+
const assets = {};
|
|
544
|
+
if (isV2) {
|
|
545
|
+
for (const [assetAddress, assetData] of data.loadDict(core_1.Dictionary.Keys.Address(), exports.DictionaryValues.AssetV2())) {
|
|
546
|
+
assets[assetAddress.toString()] = assetData;
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
else {
|
|
550
|
+
for (const [assetAddress, assetData] of data.loadDict(core_1.Dictionary.Keys.Address(), exports.DictionaryValues.AssetV1())) {
|
|
551
|
+
assets[assetAddress.toString()] = { isDepositQueueActivated: false, isWithdrawQueueActivated: false, ...assetData };
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
const factorialPools = {};
|
|
555
|
+
for (const [factorialPoolAddress, factorialPoolData] of data.loadDict(core_1.Dictionary.Keys.Address(), exports.DictionaryValues.FactorialPool())) {
|
|
556
|
+
factorialPools[factorialPoolAddress.toString()] = factorialPoolData;
|
|
557
|
+
}
|
|
558
|
+
const aggregatorIndex = data.loadCoins();
|
|
559
|
+
const rfqIndex = data.loadCoins();
|
|
560
|
+
const totalSupply = data.loadCoins();
|
|
561
|
+
const collectedManagementFee = data.loadCoins();
|
|
562
|
+
const collectedProtocolFee = data.loadCoins();
|
|
563
|
+
const isExecutingStrategy = data.loadBoolean();
|
|
564
|
+
const configCs = data.loadRef().beginParse();
|
|
565
|
+
const protocolFeeManagerAddress = configCs.loadAddress();
|
|
566
|
+
const manager = configCs.loadAddress();
|
|
567
|
+
const isPrivateVault = configCs.loadBit();
|
|
568
|
+
const depositCloseTimestamp = configCs.loadUint(40);
|
|
569
|
+
const withdrawOpenTimestamp = configCs.loadUint(40);
|
|
570
|
+
const whitelistedMinters = configCs.loadDict(core_1.Dictionary.Keys.Address(), exports.DictionaryValues.Empty());
|
|
571
|
+
const lastCollectTime = configCs.loadUint(40);
|
|
572
|
+
const managementFeeRatePerYear = configCs.loadUint(14);
|
|
573
|
+
const protocolFeeRatePerYear = configCs.loadUint(14);
|
|
574
|
+
const maxLeverageRatio = configCs.loadUint(20);
|
|
575
|
+
const _assetWalletDict = configCs.loadDict(core_1.Dictionary.Keys.Address(), core_1.Dictionary.Values.Address());
|
|
576
|
+
const assetWalletDict = {};
|
|
577
|
+
for (const asset of _assetWalletDict.keys()) {
|
|
578
|
+
const wallet = _assetWalletDict.get(asset);
|
|
579
|
+
if (wallet) {
|
|
580
|
+
assetWalletDict[asset.toString()] = wallet.toString();
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
const _walletAssetDict = configCs.loadDict(core_1.Dictionary.Keys.Address(), core_1.Dictionary.Values.Address());
|
|
584
|
+
const walletAssetDict = {};
|
|
585
|
+
for (const wallet of _walletAssetDict.keys()) {
|
|
586
|
+
const asset = _walletAssetDict.get(wallet);
|
|
587
|
+
if (asset) {
|
|
588
|
+
walletAssetDict[wallet.toString()] = asset.toString();
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
const configCs2 = configCs.loadRef().beginParse();
|
|
592
|
+
const rfqConfig = parseRFQConfig(configCs2.loadMaybeRef());
|
|
593
|
+
const gasConfig = parseGasConfig(configCs2.loadMaybeRef());
|
|
594
|
+
const oracleConfig = (0, parser_1.parseOracleConfig)(configCs2.loadMaybeRef());
|
|
595
|
+
const managementFeeRecipientAddress = configCs2.loadMaybeAddress();
|
|
596
|
+
const guardianAddress = configCs2.loadMaybeAddress();
|
|
597
|
+
const timelock = configCs2.loadCoins();
|
|
598
|
+
const pendingOwnerActionIndex = configCs2.loadCoins();
|
|
599
|
+
const pendingOwnerActionCount = configCs2.loadCoins();
|
|
600
|
+
const _pendingOwnerAction = configCs2.loadMaybeRef();
|
|
601
|
+
const pendingOwnerAction = {};
|
|
602
|
+
if (_pendingOwnerAction) {
|
|
603
|
+
const pendingOwnerActionData = _pendingOwnerAction
|
|
604
|
+
.beginParse()
|
|
605
|
+
.loadDictDirect(core_1.Dictionary.Keys.Uint(128), exports.DictionaryValues.PendingOwnerAction());
|
|
606
|
+
for (const key of pendingOwnerActionData.keys()) {
|
|
607
|
+
const ownerAction = pendingOwnerActionData.get(key);
|
|
608
|
+
if (ownerAction) {
|
|
609
|
+
pendingOwnerAction[key.toString()] = ownerAction;
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
const codeCs = data.loadRef().beginParse();
|
|
614
|
+
const walletCode = codeCs.loadRef();
|
|
615
|
+
const dataAggregatorCode = codeCs.loadRef();
|
|
616
|
+
const rfqCode = codeCs.loadRef();
|
|
617
|
+
const content = codeCs.loadRef();
|
|
618
|
+
return {
|
|
619
|
+
owner, manager, assets, factorialPools, aggregatorIndex, content, totalSupply,
|
|
620
|
+
oracleConfig, rfqConfig, gasConfig, isPrivateVault, depositCloseTimestamp,
|
|
621
|
+
withdrawOpenTimestamp, whitelistedMinters, lastCollectTime, managementFeeRatePerYear,
|
|
622
|
+
protocolFeeRatePerYear, collectedManagementFee, collectedProtocolFee, rfqCode,
|
|
623
|
+
walletCode, dataAggregatorCode, protocolFeeManagerAddress, rfqIndex,
|
|
624
|
+
isExecutingStrategy, maxLeverageRatio, assetWalletDict, walletAssetDict,
|
|
625
|
+
managementFeeRecipientAddress, guardianAddress, timelock, pendingOwnerActionIndex,
|
|
626
|
+
pendingOwnerActionCount, pendingOwnerAction,
|
|
627
|
+
getFactorialPoolAsset: (poolAddress, assetAddress) => {
|
|
628
|
+
const factorialPool = factorialPools[poolAddress.toString()];
|
|
629
|
+
if (!factorialPool)
|
|
630
|
+
throw "not found factorial pool";
|
|
631
|
+
const factorialPoolAsset = factorialPool[assetAddress.toString()];
|
|
632
|
+
if (!factorialPoolAsset)
|
|
633
|
+
throw "not found factorial pool asset";
|
|
634
|
+
return factorialPoolAsset;
|
|
635
|
+
},
|
|
636
|
+
getAsset: (assetAddress) => { return assets[assetAddress.toString()]; },
|
|
637
|
+
};
|
|
638
|
+
}
|
|
639
|
+
function parseVaultDataV2(slice) {
|
|
640
|
+
const ref0 = slice.loadRef().beginParse();
|
|
641
|
+
const globalDepositValueCap = ref0.loadCoins();
|
|
642
|
+
const withdrawFeeRate = ref0.loadUint(14);
|
|
643
|
+
const queueWithdrawFeeRate = ref0.loadUint(14);
|
|
644
|
+
const depositQueueManager = exports.DictionaryValues.QueueManager().parse(ref0.loadRef().beginParse());
|
|
645
|
+
const withdrawQueueManager = exports.DictionaryValues.QueueManager().parse(ref0.loadRef().beginParse());
|
|
646
|
+
const interactiveVaultDictCell = ref0.loadMaybeRef();
|
|
647
|
+
const interactiveVaultDict = interactiveVaultDictCell
|
|
648
|
+
? exports.DictionaryValues.InteractiveVaultDict().parse(interactiveVaultDictCell.beginParse())
|
|
649
|
+
: {};
|
|
650
|
+
const ref1 = slice.loadRef().beginParse();
|
|
651
|
+
const xchainConnectorAddress = ref1.loadMaybeAddress();
|
|
652
|
+
const __xchainConfig = ref1.loadMaybeRef();
|
|
653
|
+
let xchainConfig = {};
|
|
654
|
+
if (__xchainConfig) {
|
|
655
|
+
const xchainConfigCs = __xchainConfig.beginParse();
|
|
656
|
+
const xchainConfigDict = xchainConfigCs.loadDictDirect(core_1.Dictionary.Keys.Uint(32), exports.DictionaryValues.XChainConfig());
|
|
657
|
+
xchainConfig = {};
|
|
658
|
+
for (const eid of xchainConfigDict.keys()) {
|
|
659
|
+
const _xchainConfig = xchainConfigDict.get(eid);
|
|
660
|
+
if (_xchainConfig) {
|
|
661
|
+
const { connected, xchainAccountAddress, oftConfig, strategyConfig, afterStrategyConfig, lzGasFee } = _xchainConfig;
|
|
662
|
+
const _oftConfig = oftConfig ? parseXChainOftConfig(oftConfig) : null;
|
|
663
|
+
const _strategyConfig = strategyConfig ? parseXChainStrategyConfig(strategyConfig) : null;
|
|
664
|
+
const _afterStrategyConfig = afterStrategyConfig ? parseXChainStrategyConfig(afterStrategyConfig) : null;
|
|
665
|
+
xchainConfig[eid.toString()] = { connected, xchainAccountAddress, oftConfig: _oftConfig, strategyConfig: _strategyConfig, afterStrategyConfig: _afterStrategyConfig, lzGasFee };
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
const xchainUpdateHash = ref1.loadUintBig(256);
|
|
670
|
+
return { globalDepositValueCap, withdrawFeeRate, queueWithdrawFeeRate, depositQueueManager, withdrawQueueManager, interactiveVaultDict, xchainConnectorAddress, xchainConfig, xchainUpdateHash };
|
|
671
|
+
}
|
|
672
|
+
function parseRFQConfig(rfqConfig) {
|
|
673
|
+
if (!rfqConfig)
|
|
674
|
+
return null;
|
|
675
|
+
const rfqConfigCs = rfqConfig.beginParse();
|
|
676
|
+
const priceDeviationTolerance = rfqConfigCs.loadUint(14);
|
|
677
|
+
const rfqEventEmitterAddress = rfqConfigCs.loadMaybeAddress();
|
|
678
|
+
return { priceDeviationTolerance, rfqEventEmitterAddress: rfqEventEmitterAddress ? rfqEventEmitterAddress.toString() : null };
|
|
679
|
+
}
|
|
680
|
+
function parseGasConfig(gasConfig) {
|
|
681
|
+
if (!gasConfig)
|
|
682
|
+
return null;
|
|
683
|
+
const gasConfigCs = gasConfig.beginParse();
|
|
684
|
+
const gasDict = gasConfigCs.loadDictDirect(core_1.Dictionary.Keys.Uint(8), core_1.Dictionary.Values.BigVarUint(4));
|
|
685
|
+
const gasDictObj = {};
|
|
686
|
+
for (const key of gasDict.keys()) {
|
|
687
|
+
const value = gasDict.get(key);
|
|
688
|
+
if (value) {
|
|
689
|
+
gasDictObj[key.toString()] = value;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
return gasDictObj;
|
|
693
|
+
}
|
|
694
|
+
function parseXChainOftConfig(cell) {
|
|
695
|
+
const dict = cell.beginParse().loadDictDirect(core_1.Dictionary.Keys.Address(), exports.DictionaryValues.XChainOftConfig());
|
|
696
|
+
const result = new Map();
|
|
697
|
+
for (const [key, value] of dict) {
|
|
698
|
+
result.set(key.toString(), value);
|
|
699
|
+
}
|
|
700
|
+
return result;
|
|
701
|
+
}
|
|
702
|
+
function parseXChainStrategyConfig(cell) {
|
|
703
|
+
const dict = cell.beginParse().loadDictDirect(core_1.Dictionary.Keys.BigUint(256), exports.DictionaryValues.XChainStrategyConfig());
|
|
704
|
+
const result = new Map();
|
|
705
|
+
for (const [key, value] of dict) {
|
|
706
|
+
result.set(key, value);
|
|
707
|
+
}
|
|
708
|
+
return result;
|
|
709
|
+
}
|
|
710
|
+
//#endregion
|
|
711
|
+
// ============================================================================
|
|
712
|
+
//#region Utility
|
|
713
|
+
// ============================================================================
|
|
714
|
+
function createRFQConfig(params) {
|
|
715
|
+
return (0, core_1.beginCell)().storeUint(params.priceDeviationTolerance, 14).storeAddress(params.eventEmitter).endCell();
|
|
716
|
+
}
|
|
717
|
+
function getOpName(opCode) {
|
|
718
|
+
const opEntries = Object.entries(constants_1.Op);
|
|
719
|
+
const opMap = Object.fromEntries(opEntries);
|
|
720
|
+
const opName = Object.keys(opMap).find((key) => opMap[key] === opCode);
|
|
721
|
+
return opName || `UnknownOp(${opCode.toString(16)})`;
|
|
722
|
+
}
|
|
723
|
+
function getErrorName(errorCode) {
|
|
724
|
+
const errorEntries = Object.entries(constants_1.ErrorCodes);
|
|
725
|
+
const errorMap = Object.fromEntries(errorEntries);
|
|
726
|
+
const errorName = Object.keys(errorMap).find((key) => errorMap[key] === errorCode);
|
|
727
|
+
return errorName || `UnknownError(${errorCode})`;
|
|
728
|
+
}
|
|
729
|
+
function createInteractiveVaultDict(vaults = {}) {
|
|
730
|
+
return Object.entries(vaults).reduce((dict, [vaultAddress, config]) => dict.set(core_1.Address.parse(vaultAddress), config), core_1.Dictionary.empty(core_1.Dictionary.Keys.Address(), exports.DictionaryValues.InteractiveVaultConfig()));
|
|
731
|
+
}
|
|
732
|
+
//#endregion
|
|
733
|
+
// ============================================================================
|
|
734
|
+
//#region Message - Owner
|
|
735
|
+
// ============================================================================
|
|
736
|
+
// --- Timelock ---
|
|
737
|
+
function createSetTimelockMsgBody(timelock, queryID) {
|
|
738
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.QueueOwnerAction, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.SetTimelock, 32).storeCoins(timelock).endCell();
|
|
739
|
+
}
|
|
740
|
+
function createExecuteOwnerActionMsgBody(ownerActionIndex, queryID) {
|
|
741
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.ExecuteOwnerAction, 32).storeUint(queryID ?? 0, 64).storeCoins(ownerActionIndex).endCell();
|
|
742
|
+
}
|
|
743
|
+
function createRevertOwnerActionMsgBody(ownerActionIndex, queryID) {
|
|
744
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.RevertOwnerAction, 32).storeUint(queryID ?? 0, 64).storeCoins(ownerActionIndex).endCell();
|
|
745
|
+
}
|
|
746
|
+
function parseSetTimelockMsgBody(cell) {
|
|
747
|
+
const slice = cell.beginParse();
|
|
748
|
+
const op = slice.loadUint(32);
|
|
749
|
+
const queryID = slice.loadUint(64);
|
|
750
|
+
const ownerOp = slice.loadUint(32);
|
|
751
|
+
const timelock = slice.loadCoins();
|
|
752
|
+
return { op, queryID, ownerOp, timelock };
|
|
753
|
+
}
|
|
754
|
+
function parseExecuteOwnerActionMsgBody(cell) {
|
|
755
|
+
const slice = cell.beginParse();
|
|
756
|
+
const op = slice.loadUint(32);
|
|
757
|
+
const queryID = slice.loadUint(64);
|
|
758
|
+
const ownerActionIndex = slice.loadCoins();
|
|
759
|
+
return { op, queryID, ownerActionIndex };
|
|
760
|
+
}
|
|
761
|
+
function parseRevertOwnerActionMsgBody(cell) {
|
|
762
|
+
const slice = cell.beginParse();
|
|
763
|
+
const op = slice.loadUint(32);
|
|
764
|
+
const queryID = slice.loadUint(64);
|
|
765
|
+
const ownerActionIndex = slice.loadCoins();
|
|
766
|
+
return { op, queryID, ownerActionIndex };
|
|
767
|
+
}
|
|
768
|
+
// --- Fee ---
|
|
769
|
+
function createSetProtocolFeeRatePerYearMsgBody(protocolFeeRate, queryID) {
|
|
770
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.SetProtocolFeeRatePerYear, 32).storeUint(queryID ?? 0, 64).storeUint(protocolFeeRate, 14).endCell();
|
|
771
|
+
}
|
|
772
|
+
function createSetProtocolFeeManagerAddressMsgBody(protocolFeeManagerAddress, queryID) {
|
|
773
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.SetProtocolFeeManagerAddress, 32).storeUint(queryID ?? 0, 64).storeAddress(protocolFeeManagerAddress).endCell();
|
|
774
|
+
}
|
|
775
|
+
function createClaimProtocolFeeMsgBody(receiverAddress, queryID) {
|
|
776
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.ClaimProtocolFee, 32).storeUint(queryID ?? 0, 64).storeAddress(receiverAddress).endCell();
|
|
777
|
+
}
|
|
778
|
+
function createSetManagementFeeRatePerYearMsgBody(managementFeeRate, queryID) {
|
|
779
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.QueueOwnerAction, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.SetManagementFeeRatePerYear, 32).storeUint(managementFeeRate, 14).endCell();
|
|
780
|
+
}
|
|
781
|
+
function createSetManagementFeeRecipientAddressMsgBody(managementFeeRecipientAddress, queryID) {
|
|
782
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.QueueOwnerAction, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.SetManagementFeeRecipientAddress, 32).storeAddress(managementFeeRecipientAddress).endCell();
|
|
783
|
+
}
|
|
784
|
+
function createClaimManagementFeeMsgBody(receiverAddress, queryID) {
|
|
785
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.ClaimManagementFee, 32).storeUint(queryID ?? 0, 64).storeAddress(receiverAddress).endCell();
|
|
786
|
+
}
|
|
787
|
+
function parseSetProtocolFeeRatePerYearMsgBody(cell) {
|
|
788
|
+
const slice = cell.beginParse();
|
|
789
|
+
return { op: slice.loadUint(32), queryID: slice.loadUint(64), protocolFeeRate: slice.loadUint(14) };
|
|
790
|
+
}
|
|
791
|
+
function parseSetProtocolFeeManagerAddressMsgBody(cell) {
|
|
792
|
+
const slice = cell.beginParse();
|
|
793
|
+
return { op: slice.loadUint(32), queryID: slice.loadUint(64), protocolFeeManagerAddress: slice.loadAddress() };
|
|
794
|
+
}
|
|
795
|
+
function parseClaimProtocolFeeMsgBody(cell) {
|
|
796
|
+
const slice = cell.beginParse();
|
|
797
|
+
return { op: slice.loadUint(32), queryID: slice.loadUint(64), receiverAddress: slice.loadAddress() };
|
|
798
|
+
}
|
|
799
|
+
function parseSetManagementFeeRatePerYearMsgBody(cell) {
|
|
800
|
+
const slice = cell.beginParse();
|
|
801
|
+
return { op: slice.loadUint(32), queryID: slice.loadUint(64), ownerOp: slice.loadUint(32), managementFeeRate: slice.loadUint(14) };
|
|
802
|
+
}
|
|
803
|
+
function parseSetManagementFeeRecipientAddressMsgBody(cell) {
|
|
804
|
+
const slice = cell.beginParse();
|
|
805
|
+
return { op: slice.loadUint(32), queryID: slice.loadUint(64), ownerOp: slice.loadUint(32), managementFeeRecipientAddress: slice.loadAddress() };
|
|
806
|
+
}
|
|
807
|
+
function parseClaimManagementFeeMsgBody(cell) {
|
|
808
|
+
const slice = cell.beginParse();
|
|
809
|
+
return { op: slice.loadUint(32), queryID: slice.loadUint(64), receiverAddress: slice.loadAddress() };
|
|
810
|
+
}
|
|
811
|
+
// --- Code ---
|
|
812
|
+
function createSetWalletCodeMsgBody(walletCode, queryID) {
|
|
813
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.QueueOwnerAction, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.SetWalletCode, 32).storeRef(walletCode).endCell();
|
|
814
|
+
}
|
|
815
|
+
function createSetDataAggregatorCodeMsgBody(dataAggregatorCode, queryID) {
|
|
816
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.QueueOwnerAction, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.SetDataAggregatorCode, 32).storeRef(dataAggregatorCode).endCell();
|
|
817
|
+
}
|
|
818
|
+
function createSetRFQCodeMsgBody(rfqCode, queryID) {
|
|
819
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.QueueOwnerAction, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.SetRFQCode, 32).storeRef(rfqCode).endCell();
|
|
820
|
+
}
|
|
821
|
+
function createUpgradeCodeMsgBody(newCode, queryID) {
|
|
822
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.QueueOwnerAction, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.UpgradeCode, 32).storeRef(newCode).endCell();
|
|
823
|
+
}
|
|
824
|
+
function createSetContentMsgBody(content, queryID) {
|
|
825
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.QueueOwnerAction, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.SetContent, 32).storeRef(content).endCell();
|
|
826
|
+
}
|
|
827
|
+
function parseSetWalletCodeMsgBody(cell) {
|
|
828
|
+
const slice = cell.beginParse();
|
|
829
|
+
return { op: slice.loadUint(32), queryID: slice.loadUint(64), ownerOp: slice.loadUint(32), walletCode: slice.loadRef() };
|
|
830
|
+
}
|
|
831
|
+
function parseSetDataAggregatorCodeMsgBody(cell) {
|
|
832
|
+
const slice = cell.beginParse();
|
|
833
|
+
return { op: slice.loadUint(32), queryID: slice.loadUint(64), ownerOp: slice.loadUint(32), dataAggregatorCode: slice.loadRef() };
|
|
834
|
+
}
|
|
835
|
+
function parseSetRFQCodeMsgBody(cell) {
|
|
836
|
+
const slice = cell.beginParse();
|
|
837
|
+
return { op: slice.loadUint(32), queryID: slice.loadUint(64), ownerOp: slice.loadUint(32), rfqCode: slice.loadRef() };
|
|
838
|
+
}
|
|
839
|
+
function parseUpgradeCodeMsgBody(cell) {
|
|
840
|
+
const slice = cell.beginParse();
|
|
841
|
+
return { op: slice.loadUint(32), queryID: slice.loadUint(64), ownerOp: slice.loadUint(32), newCode: slice.loadRef() };
|
|
842
|
+
}
|
|
843
|
+
function parseSetContentMsgBody(cell) {
|
|
844
|
+
const slice = cell.beginParse();
|
|
845
|
+
return { op: slice.loadUint(32), queryID: slice.loadUint(64), ownerOp: slice.loadUint(32), content: slice.loadRef() };
|
|
846
|
+
}
|
|
847
|
+
// --- Role ---
|
|
848
|
+
function createSetOwnerAddressMsgBody(newOwner, queryID) {
|
|
849
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.QueueOwnerAction, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.SetOwnerAddress, 32).storeAddress(newOwner).endCell();
|
|
850
|
+
}
|
|
851
|
+
function createSetGuardianAddressMsgBody(guardianAddress, queryID) {
|
|
852
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.QueueOwnerAction, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.SetGuardianAddress, 32).storeAddress(guardianAddress).endCell();
|
|
853
|
+
}
|
|
854
|
+
function createSetManagerAddressMsgBody(managerAddress, queryID) {
|
|
855
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.QueueOwnerAction, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.SetManagerAddress, 32).storeAddress(managerAddress).endCell();
|
|
856
|
+
}
|
|
857
|
+
function parseSetOwnerAddressMsgBody(cell) {
|
|
858
|
+
const slice = cell.beginParse();
|
|
859
|
+
return { op: slice.loadUint(32), queryID: slice.loadUint(64), ownerOp: slice.loadUint(32), newOwner: slice.loadAddress() };
|
|
860
|
+
}
|
|
861
|
+
function parseSetGuardianAddressMsgBody(cell) {
|
|
862
|
+
const slice = cell.beginParse();
|
|
863
|
+
return { op: slice.loadUint(32), queryID: slice.loadUint(64), ownerOp: slice.loadUint(32), guardianAddress: slice.loadAddress() };
|
|
864
|
+
}
|
|
865
|
+
function parseSetManagerAddressMsgBody(cell) {
|
|
866
|
+
const slice = cell.beginParse();
|
|
867
|
+
return { op: slice.loadUint(32), queryID: slice.loadUint(64), ownerOp: slice.loadUint(32), managerAddress: slice.loadAddress() };
|
|
868
|
+
}
|
|
869
|
+
// --- Asset ---
|
|
870
|
+
function createSetAssetConfigMsgBody(assetAddress, isWhitelisted, isDepositable, isWithdrawable, exposureCap, queryID) {
|
|
871
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.QueueOwnerAction, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.SetAssetConfig, 32).storeAddress(assetAddress).storeBit(isWhitelisted).storeBit(isDepositable).storeBit(isWithdrawable).storeUint(exposureCap, 20).endCell();
|
|
872
|
+
}
|
|
873
|
+
function createSetAssetConfigV2MsgBody(assetAddress, isWhitelisted, isDepositable, isWithdrawable, isDepositQueueActivated, isWithdrawQueueActivated, exposureCap, queryID) {
|
|
874
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.QueueOwnerAction, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.SetAssetConfig, 32).storeAddress(assetAddress).storeUint(isWhitelisted ? 1 : 0, 1).storeUint(isDepositable ? 1 : 0, 1).storeUint(isWithdrawable ? 1 : 0, 1).storeUint(isDepositQueueActivated ? 1 : 0, 1).storeUint(isWithdrawQueueActivated ? 1 : 0, 1).storeUint(exposureCap, 20).endCell();
|
|
875
|
+
}
|
|
876
|
+
function parseSetAssetConfigMsgBody(cell) {
|
|
877
|
+
const slice = cell.beginParse();
|
|
878
|
+
const op = slice.loadUint(32);
|
|
879
|
+
const queryID = slice.loadUint(64);
|
|
880
|
+
const ownerOp = slice.loadUint(32);
|
|
881
|
+
const assetAddress = slice.loadAddress();
|
|
882
|
+
const isWhitelisted = slice.loadBit();
|
|
883
|
+
const isDepositable = slice.loadBit();
|
|
884
|
+
const isWithdrawable = slice.loadBit();
|
|
885
|
+
const exposureCap = slice.loadUint(20);
|
|
886
|
+
return { op, queryID, ownerOp, assetAddress, isWhitelisted, isDepositable, isWithdrawable, exposureCap };
|
|
887
|
+
}
|
|
888
|
+
// --- Pool Config ---
|
|
889
|
+
function createSetFactorialPoolConfigMsgBody(updateConfig, queryID) {
|
|
890
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.QueueOwnerAction, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.SetFactorialPoolConfig, 32).storeMaybeRef(updateConfig).endCell();
|
|
891
|
+
}
|
|
892
|
+
function parseSetFactorialPoolConfigMsgBody(cell) {
|
|
893
|
+
const slice = cell.beginParse();
|
|
894
|
+
return { op: slice.loadUint(32), queryID: slice.loadUint(64), ownerOp: slice.loadUint(32), updateConfig: slice.loadMaybeRef() };
|
|
895
|
+
}
|
|
896
|
+
// --- RFQ Config ---
|
|
897
|
+
function createSetRFQConfigMsgBody(rfqConfig, queryID) {
|
|
898
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.QueueOwnerAction, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.SetRFQConfig, 32).storeMaybeRef(rfqConfig).endCell();
|
|
899
|
+
}
|
|
900
|
+
function parseSetRFQConfigMsgBody(cell) {
|
|
901
|
+
const slice = cell.beginParse();
|
|
902
|
+
return { op: slice.loadUint(32), queryID: slice.loadUint(64), ownerOp: slice.loadUint(32), rfqConfig: slice.loadMaybeRef() };
|
|
903
|
+
}
|
|
904
|
+
// --- Oracle Config ---
|
|
905
|
+
function createSetOracleConfigMsgBody(oracleConfig, queryID) {
|
|
906
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.QueueOwnerAction, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.SetOracleConfig, 32).storeMaybeRef(oracleConfig).endCell();
|
|
907
|
+
}
|
|
908
|
+
function parseSetOracleConfigMsgBody(cell) {
|
|
909
|
+
const slice = cell.beginParse();
|
|
910
|
+
return { op: slice.loadUint(32), queryID: slice.loadUint(64), ownerOp: slice.loadUint(32), oracleConfig: slice.loadMaybeRef() };
|
|
911
|
+
}
|
|
912
|
+
// --- Gas Config ---
|
|
913
|
+
function createSetGasConfigMsgBody(gasConfig, queryID) {
|
|
914
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.QueueOwnerAction, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.SetGasConfig, 32).storeMaybeRef(gasConfig).endCell();
|
|
915
|
+
}
|
|
916
|
+
function parseSetGasConfigMsgBody(cell) {
|
|
917
|
+
const slice = cell.beginParse();
|
|
918
|
+
return { op: slice.loadUint(32), queryID: slice.loadUint(64), ownerOp: slice.loadUint(32), gasConfig: slice.loadMaybeRef() };
|
|
919
|
+
}
|
|
920
|
+
// --- Access ---
|
|
921
|
+
function createSetPrivateVaultMsgBody(isPrivateVault, queryID) {
|
|
922
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.QueueOwnerAction, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.SetPrivateVault, 32).storeBit(isPrivateVault).endCell();
|
|
923
|
+
}
|
|
924
|
+
function createSetWhitelistedMintersMsgBody(whitelistedMinters, queryID) {
|
|
925
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.QueueOwnerAction, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.SetWhitelistedMinters, 32).storeMaybeRef(whitelistedMinters).endCell();
|
|
926
|
+
}
|
|
927
|
+
function parseSetPrivateVaultMsgBody(cell) {
|
|
928
|
+
const slice = cell.beginParse();
|
|
929
|
+
return { op: slice.loadUint(32), queryID: slice.loadUint(64), ownerOp: slice.loadUint(32), isPrivateVault: slice.loadBit() };
|
|
930
|
+
}
|
|
931
|
+
function parseSetWhitelistedMintersMsgBody(cell) {
|
|
932
|
+
const slice = cell.beginParse();
|
|
933
|
+
return { op: slice.loadUint(32), queryID: slice.loadUint(64), ownerOp: slice.loadUint(32), whitelistedMinters: slice.loadMaybeRef() };
|
|
934
|
+
}
|
|
935
|
+
// --- Limits ---
|
|
936
|
+
function createSetMaxLeverageRatioMsgBody(maxLeverageRatio, queryID) {
|
|
937
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.QueueOwnerAction, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.SetMaxLeverageRatio, 32).storeUint(maxLeverageRatio, 20).endCell();
|
|
938
|
+
}
|
|
939
|
+
function createSetGlobalDepositValueCapMsgBody(globalDepositValueCap, queryID) {
|
|
940
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.QueueOwnerAction, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.SetGlobalDepositValueCap, 32).storeCoins(globalDepositValueCap).endCell();
|
|
941
|
+
}
|
|
942
|
+
function createSetDepositCloseTimestampMsgBody(depositCloseTimestamp, queryID) {
|
|
943
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.QueueOwnerAction, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.SetDepositCloseTimestamp, 32).storeUint(depositCloseTimestamp, 40).endCell();
|
|
944
|
+
}
|
|
945
|
+
function createSetWithdrawOpenTimestampMsgBody(withdrawOpenTimestamp, queryID) {
|
|
946
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.QueueOwnerAction, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.SetWithdrawOpenTimestamp, 32).storeUint(withdrawOpenTimestamp, 40).endCell();
|
|
947
|
+
}
|
|
948
|
+
function createSetWithdrawFeeRateMsgBody(withdrawFeeRate, queryID) {
|
|
949
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.QueueOwnerAction, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.SetWithdrawFeeRate, 32).storeUint(withdrawFeeRate, 14).endCell();
|
|
950
|
+
}
|
|
951
|
+
function createSetQueueWithdrawFeeRateMsgBody(queueWithdrawFeeRate, queryID) {
|
|
952
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.QueueOwnerAction, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.SetQueueWithdrawFeeRate, 32).storeUint(queueWithdrawFeeRate, 14).endCell();
|
|
953
|
+
}
|
|
954
|
+
function parseSetMaxLeverageRatioMsgBody(cell) {
|
|
955
|
+
const slice = cell.beginParse();
|
|
956
|
+
return { op: slice.loadUint(32), queryID: slice.loadUint(64), ownerOp: slice.loadUint(32), maxLeverageRatio: slice.loadUint(20) };
|
|
957
|
+
}
|
|
958
|
+
function parseSetDepositCloseTimestampMsgBody(cell) {
|
|
959
|
+
const slice = cell.beginParse();
|
|
960
|
+
return { op: slice.loadUint(32), queryID: slice.loadUint(64), ownerOp: slice.loadUint(32), depositCloseTimestamp: slice.loadCoins() };
|
|
961
|
+
}
|
|
962
|
+
function parseSetWithdrawOpenTimestampMsgBody(cell) {
|
|
963
|
+
const slice = cell.beginParse();
|
|
964
|
+
return { op: slice.loadUint(32), queryID: slice.loadUint(64), ownerOp: slice.loadUint(32), withdrawOpenTimestamp: slice.loadCoins() };
|
|
965
|
+
}
|
|
966
|
+
// --- XChain Config ---
|
|
967
|
+
function createSetXChainConnectorAddressMsgBody(xchainConnectorAddress, queryID) {
|
|
968
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.QueueOwnerAction, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.SetXChainConnectorAddress, 32).storeAddress(xchainConnectorAddress).endCell();
|
|
969
|
+
}
|
|
970
|
+
function createSetXChainConfigMsgBody(eid, connected, xchainAccountAddress, oftConfig, strategyConfig, afterStrategyConfig, lzGasFee, queryID) {
|
|
971
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.QueueOwnerAction, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.SetXChainConfig, 32).storeUint(eid, 32).storeBit(connected).storeUint(xchainAccountAddress ?? 0, 256).storeMaybeRef(oftConfig).storeMaybeRef(strategyConfig).storeMaybeRef(afterStrategyConfig).storeCoins(lzGasFee ?? 500000000n).endCell();
|
|
972
|
+
}
|
|
973
|
+
function createRequestEidConnectionMsgBody(eid, queryID) {
|
|
974
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.QueueOwnerAction, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.RequestEidConnection, 32).storeUint(eid, 32).endCell();
|
|
975
|
+
}
|
|
976
|
+
// --- Interactive Vault Config ---
|
|
977
|
+
function createSetInteractiveVaultConfigMsgBody(interactiveVaultDict, queryID) {
|
|
978
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.QueueOwnerAction, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.SetInteractiveVaults, 32).storeDict(interactiveVaultDict).endCell();
|
|
979
|
+
}
|
|
980
|
+
//#endregion
|
|
981
|
+
// ============================================================================
|
|
982
|
+
//#region Message - Manager
|
|
983
|
+
// ============================================================================
|
|
984
|
+
// --- Base ---
|
|
985
|
+
function createInitializeMsgBody(queryID) {
|
|
986
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.Initialize, 32).storeUint(queryID ?? 0, 64).endCell();
|
|
987
|
+
}
|
|
988
|
+
function createExecuteStrategyMsgBody(body, queryID) {
|
|
989
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.ExecuteStrategy, 32).storeUint(queryID ?? 0, 64).storeBuilder(body).endCell();
|
|
990
|
+
}
|
|
991
|
+
function parseInitializeMsgBody(cell) {
|
|
992
|
+
const slice = cell.beginParse();
|
|
993
|
+
return { op: slice.loadUint(32), queryID: slice.loadUint(64) };
|
|
994
|
+
}
|
|
995
|
+
function parseExecuteStrategyMsgBody(cell) {
|
|
996
|
+
const slice = cell.beginParse();
|
|
997
|
+
return { op: slice.loadUint(32), queryID: slice.loadUint(64) };
|
|
998
|
+
}
|
|
999
|
+
// --- Pool ---
|
|
1000
|
+
function createSupplyToFactorialMsgBody(pool, asset, amount, response, queryID) {
|
|
1001
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.ExecuteStrategy, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.SupplyToFactorial, 32).storeAddress(pool).storeAddress(asset).storeCoins(amount).storeAddress(response).endCell();
|
|
1002
|
+
}
|
|
1003
|
+
function createWithdrawFromFactorialMsgBody(oracleParams, pool, asset, amount, isShare, response, queryID) {
|
|
1004
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.ExecuteStrategy, 32).storeUint(queryID ?? 0, 64).storeRef(oracleParams).storeUint(constants_1.Op.WithdrawFromFactorial, 32).storeAddress(pool).storeAddress(asset).storeCoins(amount).storeBit(isShare).storeAddress(response).endCell();
|
|
1005
|
+
}
|
|
1006
|
+
function createBorrowFromFactorialMsgBody(oracleParams, pool, asset, amount, isShare, response, queryID) {
|
|
1007
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.ExecuteStrategy, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.BorrowFromFactorial, 32).storeMaybeRef(oracleParams).storeRef(oracleParams).storeAddress(pool).storeAddress(asset).storeCoins(amount).storeBit(isShare).storeAddress(response).endCell();
|
|
1008
|
+
}
|
|
1009
|
+
function createRepayToFactorialMsgBody(pool, asset, amount, response, queryID) {
|
|
1010
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.ExecuteStrategy, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.RepayToFactorial, 32).storeAddress(pool).storeAddress(asset).storeCoins(amount).storeAddress(response).endCell();
|
|
1011
|
+
}
|
|
1012
|
+
function createLiquidateToFactorialMsgBody(oracleParams, pool, borrower, repayAsset, seizeAsset, repayAmount, response, queryID) {
|
|
1013
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.ExecuteStrategy, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.LiquidateToFactorial, 32).storeMaybeRef(oracleParams).storeRef(oracleParams).storeAddress(pool).storeAddress(borrower).storeAddress(repayAsset).storeRef((0, core_1.beginCell)().storeAddress(seizeAsset).storeCoins(repayAmount).storeAddress(response).endCell()).endCell();
|
|
1014
|
+
}
|
|
1015
|
+
function parseSupplyToFactorialMsgBody(cell) {
|
|
1016
|
+
const slice = cell.beginParse();
|
|
1017
|
+
const op = slice.loadUint(32);
|
|
1018
|
+
const queryID = slice.loadUint(64);
|
|
1019
|
+
const subOp = slice.loadUint(32);
|
|
1020
|
+
const pool = slice.loadAddress();
|
|
1021
|
+
const asset = slice.loadAddress();
|
|
1022
|
+
const amount = slice.loadCoins();
|
|
1023
|
+
const response = slice.loadAddress();
|
|
1024
|
+
return { op, queryID, subOp, pool, asset, amount, response };
|
|
1025
|
+
}
|
|
1026
|
+
function parseWithdrawFromFactorialMsgBody(cell) {
|
|
1027
|
+
const slice = cell.beginParse();
|
|
1028
|
+
const op = slice.loadUint(32);
|
|
1029
|
+
const queryID = slice.loadUint(64);
|
|
1030
|
+
slice.loadRef();
|
|
1031
|
+
const subOp = slice.loadUint(32);
|
|
1032
|
+
const pool = slice.loadAddress();
|
|
1033
|
+
const asset = slice.loadAddress();
|
|
1034
|
+
const amount = slice.loadCoins();
|
|
1035
|
+
const isShare = slice.loadBit();
|
|
1036
|
+
const response = slice.loadAddress();
|
|
1037
|
+
const oracleParams = slice.loadRef();
|
|
1038
|
+
return { op, queryID, subOp, oracleParams, pool, asset, amount, isShare, response };
|
|
1039
|
+
}
|
|
1040
|
+
function parseBorrowFromFactorialMsgBody(cell) {
|
|
1041
|
+
const slice = cell.beginParse();
|
|
1042
|
+
const op = slice.loadUint(32);
|
|
1043
|
+
const queryID = slice.loadUint(64);
|
|
1044
|
+
const subOp = slice.loadUint(32);
|
|
1045
|
+
const oracleParams = slice.loadMaybeRef();
|
|
1046
|
+
slice.loadRef();
|
|
1047
|
+
const pool = slice.loadAddress();
|
|
1048
|
+
const asset = slice.loadAddress();
|
|
1049
|
+
const amount = slice.loadCoins();
|
|
1050
|
+
const isShare = slice.loadBit();
|
|
1051
|
+
const response = slice.loadAddress();
|
|
1052
|
+
return { op, queryID, subOp, oracleParams, pool, asset, amount, isShare, response };
|
|
1053
|
+
}
|
|
1054
|
+
function parseRepayToFactorialMsgBody(cell) {
|
|
1055
|
+
const slice = cell.beginParse();
|
|
1056
|
+
const op = slice.loadUint(32);
|
|
1057
|
+
const queryID = slice.loadUint(64);
|
|
1058
|
+
const subOp = slice.loadUint(32);
|
|
1059
|
+
const pool = slice.loadAddress();
|
|
1060
|
+
const asset = slice.loadAddress();
|
|
1061
|
+
const amount = slice.loadCoins();
|
|
1062
|
+
const response = slice.loadAddress();
|
|
1063
|
+
return { op, queryID, subOp, pool, asset, amount, response };
|
|
1064
|
+
}
|
|
1065
|
+
function parseLiquidateToFactorialMsgBody(cell) {
|
|
1066
|
+
const slice = cell.beginParse();
|
|
1067
|
+
const op = slice.loadUint(32);
|
|
1068
|
+
const queryID = slice.loadUint(64);
|
|
1069
|
+
const subOp = slice.loadUint(32);
|
|
1070
|
+
const oracleParams = slice.loadMaybeRef();
|
|
1071
|
+
slice.loadRef();
|
|
1072
|
+
const pool = slice.loadAddress();
|
|
1073
|
+
const borrower = slice.loadAddress();
|
|
1074
|
+
const repayAsset = slice.loadAddress();
|
|
1075
|
+
const seizeData = slice.loadRef().beginParse();
|
|
1076
|
+
const seizeAsset = seizeData.loadAddress();
|
|
1077
|
+
const repayAmount = seizeData.loadCoins();
|
|
1078
|
+
const response = seizeData.loadAddress();
|
|
1079
|
+
return { op, queryID, subOp, oracleParams, pool, borrower, repayAsset, seizeAsset, repayAmount, response };
|
|
1080
|
+
}
|
|
1081
|
+
// --- RFQ ---
|
|
1082
|
+
function createCreateRFQMsgBody(rfqIndex, sellAsset, buyAsset, sellAssetAmount, minBuyAssetValue, maxBuyAssetValue, sellAssetRFQWallet, buyAssetRFQWallet, oracleParams, period, allowSellerCancel, allowBidderCancel, isAmountBid, queryID) {
|
|
1083
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.ExecuteStrategy, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.CreateRFQ, 32).storeMaybeRef(oracleParams).storeCoins(rfqIndex).storeAddress(sellAsset).storeAddress(buyAsset).storeCoins(sellAssetAmount).storeCoins(minBuyAssetValue).storeCoins(maxBuyAssetValue).storeRef((0, core_1.beginCell)().storeAddress(sellAssetRFQWallet).storeAddress(buyAssetRFQWallet).storeUint(period, 40).storeBit(allowSellerCancel).storeBit(allowBidderCancel).storeBit(isAmountBid).endCell()).endCell();
|
|
1084
|
+
}
|
|
1085
|
+
function createCancelRFQMsgBody(rfqIndex, queryID) {
|
|
1086
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.ExecuteStrategy, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.CancelRFQ, 32).storeCoins(rfqIndex).endCell();
|
|
1087
|
+
}
|
|
1088
|
+
function parseCreateRFQMsgBody(cell) {
|
|
1089
|
+
const slice = cell.beginParse();
|
|
1090
|
+
const op = slice.loadUint(32);
|
|
1091
|
+
const queryID = slice.loadUint(64);
|
|
1092
|
+
const subOp = slice.loadUint(32);
|
|
1093
|
+
const oracleParams = slice.loadMaybeRef();
|
|
1094
|
+
const rfqIndex = slice.loadCoins();
|
|
1095
|
+
const sellAsset = slice.loadAddress();
|
|
1096
|
+
const buyAsset = slice.loadAddress();
|
|
1097
|
+
const sellAssetAmount = slice.loadCoins();
|
|
1098
|
+
const minBuyAssetValue = slice.loadCoins();
|
|
1099
|
+
const maxBuyAssetValue = slice.loadCoins();
|
|
1100
|
+
const configSlice = slice.loadRef().beginParse();
|
|
1101
|
+
const sellAssetRFQWallet = configSlice.loadAddress();
|
|
1102
|
+
const buyAssetRFQWallet = configSlice.loadAddress();
|
|
1103
|
+
const period = configSlice.loadUint(40);
|
|
1104
|
+
const allowSellerCancel = configSlice.loadBit();
|
|
1105
|
+
const allowBidderCancel = configSlice.loadBit();
|
|
1106
|
+
const isAmountBid = configSlice.loadBit();
|
|
1107
|
+
return { op, queryID, subOp, rfqIndex, sellAsset, buyAsset, sellAssetAmount, minBuyAssetValue, maxBuyAssetValue, sellAssetRFQWallet, buyAssetRFQWallet, oracleParams, period, allowSellerCancel, allowBidderCancel, isAmountBid };
|
|
1108
|
+
}
|
|
1109
|
+
function parseCancelRFQMsgBody(cell) {
|
|
1110
|
+
const slice = cell.beginParse();
|
|
1111
|
+
return { op: slice.loadUint(32), queryID: slice.loadUint(64), subOp: slice.loadUint(32), rfqIndex: slice.loadCoins() };
|
|
1112
|
+
}
|
|
1113
|
+
// --- XChain ---
|
|
1114
|
+
function createDepositEidMsgBody(eid, assetAddress, amount, responseAddress, queryID) {
|
|
1115
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.ExecuteStrategy, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.DepositEid, 32).storeUint(eid, 32).storeAddress(assetAddress).storeCoins(amount).storeAddress(responseAddress).endCell();
|
|
1116
|
+
}
|
|
1117
|
+
function createWithdrawEidMsgBody(eid, assetAddress, amount, responseAddress, queryID) {
|
|
1118
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.ExecuteStrategy, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.WithdrawEid, 32).storeUint(eid, 32).storeAddress(assetAddress).storeCoins(amount).storeAddress(responseAddress).endCell();
|
|
1119
|
+
}
|
|
1120
|
+
function createExecuteXChainStrategyMsgBody(oracleParams, xchainStrategyPayload, xchainOraclePayload, updateConfirmData, queryID) {
|
|
1121
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.ExecuteStrategy, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.ExecuteXChainStrategy, 32).storeMaybeRef(oracleParams).storeRef(xchainStrategyPayload).storeMaybeRef(xchainOraclePayload).storeMaybeRef(updateConfirmData).endCell();
|
|
1122
|
+
}
|
|
1123
|
+
function createExecuteXChainStrategyNoValidationMsgBody(oracleParams, xchainStrategyPayload, xchainOraclePayload, queryID) {
|
|
1124
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.ExecuteStrategy, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.ExecuteXChainStrategyNoValidation, 32).storeMaybeRef(oracleParams).storeRef(xchainStrategyPayload).storeMaybeRef(xchainOraclePayload).endCell();
|
|
1125
|
+
}
|
|
1126
|
+
function createConfirmXChainUpdateMsgBody(updateData, queryID) {
|
|
1127
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.ConfirmXChainUpdate, 32).storeUint(queryID ?? 0, 64).storeMaybeRef(updateData).endCell();
|
|
1128
|
+
}
|
|
1129
|
+
function createXChainNotificationMsgBody(xchainUpdateHash, queryID) {
|
|
1130
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.XChainNotification, 32).storeUint(queryID ?? 0, 64).storeUint(xchainUpdateHash, 256).endCell();
|
|
1131
|
+
}
|
|
1132
|
+
function createTransferToXChainAccountMsgBody(eid, asset, amount, response, queryID) {
|
|
1133
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.ExecuteStrategy, 32).storeUint(queryID ?? 0, 64).storeUint(constants_1.Op.TransferToXChainAccount, 32).storeUint(eid, 32).storeAddress(asset).storeCoins(amount).storeAddress(response).endCell();
|
|
1134
|
+
}
|
|
1135
|
+
function createExecuteXChainStrategyPayload(eid, commands, states, afterCommands, afterStates, responseAddress) {
|
|
1136
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.ExecuteXChainStrategy, 32).storeUint(eid, 32).storeMaybeRef(commands).storeMaybeRef(states).storeMaybeRef(afterCommands).storeMaybeRef(afterStates).storeAddress(responseAddress).endCell();
|
|
1137
|
+
}
|
|
1138
|
+
// --- Vault Interact ---
|
|
1139
|
+
function createDepositToVaultMsgBody(opts) {
|
|
1140
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.ExecuteStrategy, 32).storeUint(opts.queryId ?? 0n, 64).storeUint(constants_1.Op.DepositToVault, 32).storeMaybeRef(opts.oracleParams).storeMaybeRef((0, core_1.beginCell)().storeAddress(opts.vaultInteractParams.vaultAddress).storeAddress(opts.vaultInteractParams.assetAddress).storeCoins(opts.vaultInteractParams.assetAmount).storeCoins(opts.vaultInteractParams.forwardTonAmount).storeMaybeRef(opts.targetVaultOracleParams).endCell()).endCell();
|
|
1141
|
+
}
|
|
1142
|
+
function createWithdrawFromVaultMsgBody(opts) {
|
|
1143
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.ExecuteStrategy, 32).storeUint(opts.queryId ?? 0n, 64).storeUint(constants_1.Op.WithdrawFromVault, 32).storeMaybeRef(opts.oracleParams).storeMaybeRef((0, core_1.beginCell)().storeAddress(opts.vaultInteractParams.targetVaultAddress).storeCoins(opts.vaultInteractParams.targetVaultAmount).storeAddress(opts.vaultInteractParams.assetAddress).storeCoins(opts.vaultInteractParams.forwardTonAmount).storeMaybeRef(opts.targetVaultOracleParams).endCell()).endCell();
|
|
1144
|
+
}
|
|
1145
|
+
function createDepositToVaultQueueMsgBody(opts) {
|
|
1146
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.ExecuteStrategy, 32).storeUint(opts.queryId ?? 0n, 64).storeUint(constants_1.Op.DepositToVaultQueue, 32).storeMaybeRef(opts.oracleParams).storeMaybeRef((0, core_1.beginCell)().storeAddress(opts.vaultQueueInteractParams.vaultAddress).storeAddress(opts.vaultQueueInteractParams.assetAddress).storeCoins(opts.vaultQueueInteractParams.assetAmount).endCell()).endCell();
|
|
1147
|
+
}
|
|
1148
|
+
function createWithdrawFromVaultQueueMsgBody(opts) {
|
|
1149
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.ExecuteStrategy, 32).storeUint(opts.queryId ?? 0n, 64).storeUint(constants_1.Op.WithdrawFromVaultQueue, 32).storeMaybeRef(opts.oracleParams).storeMaybeRef((0, core_1.beginCell)().storeAddress(opts.vaultQueueInteractParams.targetVaultAddress).storeCoins(opts.vaultQueueInteractParams.targetVaultAmount).storeAddress(opts.vaultQueueInteractParams.assetAddress).endCell()).endCell();
|
|
1150
|
+
}
|
|
1151
|
+
function createCancelDepositToVaultQueueMsgBody(targetVaultAddress, assetAddress, queryId) {
|
|
1152
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.ExecuteStrategy, 32).storeUint(queryId ?? 0n, 64).storeUint(constants_1.Op.CancelDepositToVaultQueue, 32).storeAddress(targetVaultAddress).storeAddress(assetAddress).endCell();
|
|
1153
|
+
}
|
|
1154
|
+
function createCancelWithdrawFromVaultQueueMsgBody(targetVaultAddress, assetAddress, queryId) {
|
|
1155
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.ExecuteStrategy, 32).storeUint(queryId ?? 0n, 64).storeUint(constants_1.Op.CancelWithdrawFromVaultQueue, 32).storeAddress(targetVaultAddress).storeAddress(assetAddress).endCell();
|
|
1156
|
+
}
|
|
1157
|
+
// --- Queue ---
|
|
1158
|
+
function createConfirmQueueMsgBody(depositAssets, withdrawAssets, oracleParams, queryId) {
|
|
1159
|
+
const depositDict = depositAssets.reduce((acc, asset) => acc.set(asset, null), core_1.Dictionary.empty(core_1.Dictionary.Keys.Address(), exports.DictionaryValues.Empty()));
|
|
1160
|
+
const withdrawDict = withdrawAssets.reduce((acc, asset) => acc.set(asset, null), core_1.Dictionary.empty(core_1.Dictionary.Keys.Address(), exports.DictionaryValues.Empty()));
|
|
1161
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.ConfirmQueue, 32).storeUint(queryId, 64).storeDict(depositDict).storeDict(withdrawDict).storeRef(oracleParams).endCell();
|
|
1162
|
+
}
|
|
1163
|
+
function createExecuteDepositQueueMsgBody(asset, count, queryId) {
|
|
1164
|
+
if (count > 50n) {
|
|
1165
|
+
throw new Error("count cannot be greater than 50");
|
|
1166
|
+
}
|
|
1167
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.ExecuteDepositQueue, 32).storeUint(queryId, 64).storeAddress(asset).storeCoins(count).endCell();
|
|
1168
|
+
}
|
|
1169
|
+
function createExecuteWithdrawQueueMsgBody(asset, count, queryId) {
|
|
1170
|
+
if (count > 50n) {
|
|
1171
|
+
throw new Error("count cannot be greater than 50");
|
|
1172
|
+
}
|
|
1173
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.ExecuteWithdrawQueue, 32).storeUint(queryId, 64).storeAddress(asset).storeCoins(count).endCell();
|
|
1174
|
+
}
|
|
1175
|
+
function parseExecuteDepositQueueMsgBody(cell) {
|
|
1176
|
+
const slice = cell.beginParse();
|
|
1177
|
+
return { op: slice.loadUint(32), queryID: slice.loadUint(64), assetAddress: slice.loadAddress() };
|
|
1178
|
+
}
|
|
1179
|
+
function parseExecuteWithdrawQueueMsgBody(cell) {
|
|
1180
|
+
const slice = cell.beginParse();
|
|
1181
|
+
return { op: slice.loadUint(32), queryID: slice.loadUint(64), assetAddress: slice.loadAddress() };
|
|
1182
|
+
}
|
|
1183
|
+
function parseConfirmQueueLog(cell) {
|
|
1184
|
+
const slice = cell.beginParse();
|
|
1185
|
+
return { op: slice.loadUint(32), isDeposit: slice.loadBit(), queueId: slice.loadCoins(), assetAddress: slice.loadAddress(), assetAmount: slice.loadCoins(), shareAmount: slice.loadCoins(), confirmedEXR8: slice.loadCoins() };
|
|
1186
|
+
}
|
|
1187
|
+
function parseQueueBatchExecuteLog(cell) {
|
|
1188
|
+
const slice = cell.beginParse();
|
|
1189
|
+
return {
|
|
1190
|
+
op: slice.loadUint(32), queueId: slice.loadCoins(), assetAddress: slice.loadAddress(),
|
|
1191
|
+
updatedSum: slice.loadCoins(), confirmedEXR8: slice.loadCoins(), processedCount: slice.loadUint(16),
|
|
1192
|
+
executedItems: Array.from(slice.loadDict(core_1.Dictionary.Keys.Address(), exports.DictionaryValues.RequestQueueItem())).reduce((record, [address, qItem]) => { record[address.toString()] = qItem; return record; }, {}),
|
|
1193
|
+
};
|
|
1194
|
+
}
|
|
1195
|
+
//#endregion
|
|
1196
|
+
// ============================================================================
|
|
1197
|
+
//#region Message - User
|
|
1198
|
+
// ============================================================================
|
|
1199
|
+
// --- Deposit ---
|
|
1200
|
+
function createDepositPayloadV1(oracleParams, forwardTonAmount, forwardPayload) {
|
|
1201
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.Deposit, 32).storeMaybeRef(oracleParams).storeCoins(forwardTonAmount ?? 0n).storeMaybeRef(forwardPayload).endCell();
|
|
1202
|
+
}
|
|
1203
|
+
function createDepositPayload(responseAddress, oracleParams, forwardTonAmount, forwardPayload, actionForwardTonAmount, actionForwardPayload) {
|
|
1204
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.Deposit, 32).storeAddress(responseAddress).storeMaybeRef(oracleParams).storeCoins(forwardTonAmount ?? 0n).storeMaybeRef(forwardPayload).storeCoins(actionForwardTonAmount ?? 0n).storeMaybeRef(actionForwardPayload).endCell();
|
|
1205
|
+
}
|
|
1206
|
+
function createDepositQueuePayload(responseAddress, forwardTonAmount, jettonForwardPayload, actionForwardTonAmount, actionForwardPayload) {
|
|
1207
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.DepositQueue, 32).storeAddress(responseAddress).storeCoins(forwardTonAmount ?? 0n).storeMaybeRef(jettonForwardPayload).storeCoins(actionForwardTonAmount ?? 0n).storeMaybeRef(actionForwardPayload).endCell();
|
|
1208
|
+
}
|
|
1209
|
+
// --- Withdraw ---
|
|
1210
|
+
function createWithdrawPayload(assetAddress, oracleParams, forwardTonAmount, jettonForwardPayload, actionForwardTonAmount, actionForwardPayload) {
|
|
1211
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.Withdraw, 32).storeAddress(assetAddress).storeMaybeRef(oracleParams).storeCoins(forwardTonAmount ?? 0n).storeMaybeRef(jettonForwardPayload).storeCoins(actionForwardTonAmount ?? 0n).storeMaybeRef(actionForwardPayload).endCell();
|
|
1212
|
+
}
|
|
1213
|
+
function createWithdrawQueuePayload(assetAddress, forwardTonAmount, jettonForwardPayload, actionForwardTonAmount, actionForwardPayload) {
|
|
1214
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.WithdrawQueue, 32).storeAddress(assetAddress).storeCoins(forwardTonAmount ?? 0n).storeMaybeRef(jettonForwardPayload).storeCoins(actionForwardTonAmount ?? 0n).storeMaybeRef(actionForwardPayload).endCell();
|
|
1215
|
+
}
|
|
1216
|
+
// --- Queue ---
|
|
1217
|
+
function createCancelDepositQueueMsgBody(assetAddress, userAddress, queryId) {
|
|
1218
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.CancelDepositQueue, 32).storeUint(queryId, 64).storeAddress(assetAddress).storeAddress(userAddress).endCell();
|
|
1219
|
+
}
|
|
1220
|
+
function createCancelWithdrawQueueMsgBody(assetAddress, userAddress, queryId) {
|
|
1221
|
+
return (0, core_1.beginCell)().storeUint(constants_1.Op.CancelWithdrawQueue, 32).storeUint(queryId, 64).storeAddress(assetAddress).storeAddress(userAddress).endCell();
|
|
1222
|
+
}
|
|
1223
|
+
function parseCancelDepositQueueMsgBody(cell) {
|
|
1224
|
+
const slice = cell.beginParse();
|
|
1225
|
+
return { op: slice.loadUint(32), queryID: slice.loadUint(64), assetAddress: slice.loadAddress() };
|
|
1226
|
+
}
|
|
1227
|
+
function parseCancelWithdrawQueueMsgBody(cell) {
|
|
1228
|
+
const slice = cell.beginParse();
|
|
1229
|
+
return { op: slice.loadUint(32), queryID: slice.loadUint(64), assetAddress: slice.loadAddress() };
|
|
1230
|
+
}
|
|
1231
|
+
function parseDepositQueueMsgBody(cell) {
|
|
1232
|
+
const slice = cell.beginParse();
|
|
1233
|
+
const jettonTransferNotificationOp = slice.loadUint(32);
|
|
1234
|
+
const queryID = slice.loadUint(64);
|
|
1235
|
+
const depositQueueOp = slice.loadUint(32);
|
|
1236
|
+
const actionForwardTonAmount = slice.loadCoins();
|
|
1237
|
+
const forwardTonAmount = slice.loadCoins();
|
|
1238
|
+
const forwardPayload = slice.loadMaybeRef();
|
|
1239
|
+
return { op: depositQueueOp, queryID, actionForwardTonAmount, forwardTonAmount, forwardPayload };
|
|
1240
|
+
}
|
|
1241
|
+
function parseWithdrawQueueMsgBody(cell) {
|
|
1242
|
+
const slice = cell.beginParse();
|
|
1243
|
+
const jettonTransferNotificationOp = slice.loadUint(32);
|
|
1244
|
+
const queryID = slice.loadUint(64);
|
|
1245
|
+
const withdrawQueueOp = slice.loadUint(32);
|
|
1246
|
+
const assetAddress = slice.loadAddress();
|
|
1247
|
+
const actionForwardTonAmount = slice.loadCoins();
|
|
1248
|
+
const forwardTonAmount = slice.loadCoins();
|
|
1249
|
+
const forwardPayload = slice.loadMaybeRef();
|
|
1250
|
+
return { op: withdrawQueueOp, queryID, assetAddress, actionForwardTonAmount, forwardTonAmount, forwardPayload };
|
|
1251
|
+
}
|
|
1252
|
+
function parseUserQueueLog(cell) {
|
|
1253
|
+
const slice = cell.beginParse();
|
|
1254
|
+
return { op: slice.loadUint(32), queueId: slice.loadCoins(), fromAddress: slice.loadAddress(), assetAddress: slice.loadAddress(), assetAmount: slice.loadCoins(), shareAmount: slice.loadCoins() };
|
|
1255
|
+
}
|
|
1256
|
+
//#endregion
|