@wonjm/tx-decoder-rc 0.12.0-rc.1 → 0.12.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +173 -77
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +173 -77
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1033,13 +1033,37 @@ var EVENT_SIGNATURES = {
|
|
|
1033
1033
|
|
|
1034
1034
|
// src/constants/module-addresses.ts
|
|
1035
1035
|
var USERNAME_MODULE_ADDRESSES = [
|
|
1036
|
-
"0x72ed9b26ecdcd6a21d304df50f19abfdbe31d2c02f60c84627844620a45940ef"
|
|
1036
|
+
"0x72ed9b26ecdcd6a21d304df50f19abfdbe31d2c02f60c84627844620a45940ef",
|
|
1037
1037
|
// mainnet
|
|
1038
|
+
"0x42cd8467b1c86e59bf319e5664a09b6b5840bb3fac64f5ce690b5041c530565a"
|
|
1039
|
+
// testnet
|
|
1040
|
+
];
|
|
1041
|
+
var DEX_UTILS_MODULE_ADDRESSES = [
|
|
1042
|
+
"0xb6bf50aa9d5f827458a5424d41ef81a4ef8d7fd0",
|
|
1043
|
+
// mainnet (legacy)
|
|
1044
|
+
"0xb845fba0d0072c282f6284465933c4b32b1a0d4071604935a7a8d999c85d01fb",
|
|
1045
|
+
// mainnet (current)
|
|
1046
|
+
"0x42cd8467b1c86e59bf319e5664a09b6b5840bb3fac64f5ce690b5041c530565a"
|
|
1047
|
+
// testnet
|
|
1048
|
+
];
|
|
1049
|
+
var INITIA_VAULT_MODULE_ADDRESSES = [
|
|
1050
|
+
"0x3a886b32a802582f2e446e74d4a24d1d7ed01adf46d2a8f65c5723887e708789",
|
|
1051
|
+
// mainnet
|
|
1052
|
+
"0x81c3ea419d2fd3a27971021d9dd3cc708def05e5d6a09d39b2f1f9ba18312264"
|
|
1053
|
+
// testnet
|
|
1054
|
+
];
|
|
1055
|
+
var CLAMM_MODULE_ADDRESSES = [
|
|
1056
|
+
"0xd78a3b72c7ef0cfba7286bfb8c618aa4d6011dce05a832871cc9ab323c25f55e",
|
|
1057
|
+
// mainnet
|
|
1058
|
+
"0x6b41bf295bc31cd9bef75a9a5a67e5a8d6749b34a7ab3105808251fa2697823d"
|
|
1059
|
+
// testnet
|
|
1060
|
+
];
|
|
1061
|
+
var CLAMM_FARMING_MODULE_ADDRESSES = [
|
|
1062
|
+
"0xcb2999c70a9b8db7cb473255bb01f956f0726087f08b04ece50844a6d8167351",
|
|
1063
|
+
// mainnet
|
|
1064
|
+
"0xf8ef0cb7c73607b7658524565015ce2aadc45ccf7164e5351959a4d7a1c37753"
|
|
1065
|
+
// testnet
|
|
1038
1066
|
];
|
|
1039
|
-
var DEX_UTILS_MODULE_ADDRESS = "0xb6bf50aa9d5f827458a5424d41ef81a4ef8d7fd0";
|
|
1040
|
-
var INITIA_VAULT_MODULE_ADDRESS = "0x3a886b32a802582f2e446e74d4a24d1d7ed01adf46d2a8f65c5723887e708789";
|
|
1041
|
-
var CLAMM_MODULE_ADDRESS = "0xd78a3b72c7ef0cfba7286bfb8c618aa4d6011dce05a832871cc9ab323c25f55e";
|
|
1042
|
-
var CLAMM_FARMING_MODULE_ADDRESS = "0xcb2999c70a9b8db7cb473255bb01f956f0726087f08b04ece50844a6d8167351";
|
|
1043
1067
|
|
|
1044
1068
|
// src/schema/cosmos/move.ts
|
|
1045
1069
|
var zMsgMoveExecute = import_zod12.z.object({
|
|
@@ -1063,37 +1087,37 @@ var zMsgMoveScript = import_zod12.z.object({
|
|
|
1063
1087
|
});
|
|
1064
1088
|
var zMsgDelegateLocked = zMsgMoveExecute.extend({
|
|
1065
1089
|
function_name: import_zod12.z.literal("delegate"),
|
|
1066
|
-
module_address: import_zod12.z.
|
|
1090
|
+
module_address: import_zod12.z.enum(INITIA_VAULT_MODULE_ADDRESSES),
|
|
1067
1091
|
module_name: import_zod12.z.literal("lock_staking")
|
|
1068
1092
|
});
|
|
1069
1093
|
var zMsgUndelegateLocked = zMsgMoveExecute.extend({
|
|
1070
1094
|
function_name: import_zod12.z.literal("undelegate"),
|
|
1071
|
-
module_address: import_zod12.z.
|
|
1095
|
+
module_address: import_zod12.z.enum(INITIA_VAULT_MODULE_ADDRESSES),
|
|
1072
1096
|
module_name: import_zod12.z.literal("lock_staking")
|
|
1073
1097
|
});
|
|
1074
1098
|
var zMsgRedelegateLocked = zMsgMoveExecute.extend({
|
|
1075
1099
|
function_name: import_zod12.z.literal("redelegate"),
|
|
1076
|
-
module_address: import_zod12.z.
|
|
1100
|
+
module_address: import_zod12.z.enum(INITIA_VAULT_MODULE_ADDRESSES),
|
|
1077
1101
|
module_name: import_zod12.z.literal("lock_staking")
|
|
1078
1102
|
});
|
|
1079
1103
|
var zMsgWithdrawDelegatorRewardLocked = zMsgMoveExecute.extend({
|
|
1080
1104
|
function_name: import_zod12.z.literal("withdraw_delegator_reward"),
|
|
1081
|
-
module_address: import_zod12.z.
|
|
1105
|
+
module_address: import_zod12.z.enum(INITIA_VAULT_MODULE_ADDRESSES),
|
|
1082
1106
|
module_name: import_zod12.z.literal("lock_staking")
|
|
1083
1107
|
});
|
|
1084
1108
|
var zMsgVipLockStake = zMsgMoveExecute.extend({
|
|
1085
1109
|
function_name: import_zod12.z.literal("batch_lock_stake_script"),
|
|
1086
|
-
module_address: import_zod12.z.
|
|
1110
|
+
module_address: import_zod12.z.enum(INITIA_VAULT_MODULE_ADDRESSES),
|
|
1087
1111
|
module_name: import_zod12.z.literal("vip")
|
|
1088
1112
|
});
|
|
1089
1113
|
var zMsgVipClaimEsinit = zMsgMoveExecute.extend({
|
|
1090
1114
|
function_name: import_zod12.z.literal("batch_claim_user_reward_script"),
|
|
1091
|
-
module_address: import_zod12.z.
|
|
1115
|
+
module_address: import_zod12.z.enum(INITIA_VAULT_MODULE_ADDRESSES),
|
|
1092
1116
|
module_name: import_zod12.z.literal("vip")
|
|
1093
1117
|
});
|
|
1094
1118
|
var zMsgVipGaugeVote = zMsgMoveExecute.extend({
|
|
1095
1119
|
function_name: import_zod12.z.literal("vote"),
|
|
1096
|
-
module_address: import_zod12.z.
|
|
1120
|
+
module_address: import_zod12.z.enum(INITIA_VAULT_MODULE_ADDRESSES),
|
|
1097
1121
|
module_name: import_zod12.z.literal("weight_vote")
|
|
1098
1122
|
});
|
|
1099
1123
|
var zMsgMoveDexSwap = zMsgMoveExecute.extend({
|
|
@@ -1113,7 +1137,7 @@ var zMsgMoveSimpleMint = zMsgMoveExecute.extend({
|
|
|
1113
1137
|
});
|
|
1114
1138
|
var zMsgMoveUsernameMint = zMsgMoveExecute.extend({
|
|
1115
1139
|
function_name: import_zod12.z.literal("register_domain"),
|
|
1116
|
-
module_address: import_zod12.z.
|
|
1140
|
+
module_address: import_zod12.z.enum(USERNAME_MODULE_ADDRESSES),
|
|
1117
1141
|
module_name: import_zod12.z.literal("usernames")
|
|
1118
1142
|
});
|
|
1119
1143
|
var zMsgMoveNftMint = import_zod12.z.union([
|
|
@@ -1142,12 +1166,17 @@ var zMsgClaimMinitswap = zMsgMoveExecute.extend({
|
|
|
1142
1166
|
});
|
|
1143
1167
|
var zMsgDepositStakeLiquidity = zMsgMoveExecute.extend({
|
|
1144
1168
|
function_name: import_zod12.z.literal("unproportional_provide_stake"),
|
|
1145
|
-
module_address: import_zod12.z.
|
|
1169
|
+
module_address: import_zod12.z.enum(DEX_UTILS_MODULE_ADDRESSES),
|
|
1170
|
+
module_name: import_zod12.z.literal("dex_utils")
|
|
1171
|
+
});
|
|
1172
|
+
var zMsgProvideStakeLiquidity = zMsgMoveExecute.extend({
|
|
1173
|
+
function_name: import_zod12.z.literal("provide_stake"),
|
|
1174
|
+
module_address: import_zod12.z.enum(DEX_UTILS_MODULE_ADDRESSES),
|
|
1146
1175
|
module_name: import_zod12.z.literal("dex_utils")
|
|
1147
1176
|
});
|
|
1148
1177
|
var zMsgDepositLiquidity = zMsgMoveExecute.extend({
|
|
1149
1178
|
function_name: import_zod12.z.literal("unproportional_provide"),
|
|
1150
|
-
module_address: import_zod12.z.
|
|
1179
|
+
module_address: import_zod12.z.enum(DEX_UTILS_MODULE_ADDRESSES),
|
|
1151
1180
|
module_name: import_zod12.z.literal("dex_utils")
|
|
1152
1181
|
});
|
|
1153
1182
|
var zMsgDirectDepositLiquidity = zMsgMoveExecute.extend({
|
|
@@ -1157,22 +1186,22 @@ var zMsgDirectDepositLiquidity = zMsgMoveExecute.extend({
|
|
|
1157
1186
|
});
|
|
1158
1187
|
var zMsgDepositStakeLockLiquidity = zMsgMoveExecute.extend({
|
|
1159
1188
|
function_name: import_zod12.z.literal("unproportional_provide_lock_stake"),
|
|
1160
|
-
module_address: import_zod12.z.
|
|
1189
|
+
module_address: import_zod12.z.enum(DEX_UTILS_MODULE_ADDRESSES),
|
|
1161
1190
|
module_name: import_zod12.z.literal("dex_utils")
|
|
1162
1191
|
});
|
|
1163
1192
|
var zMsgProvideDelegateLiquidity = zMsgMoveExecute.extend({
|
|
1164
1193
|
function_name: import_zod12.z.literal("provide_delegate"),
|
|
1165
|
-
module_address: import_zod12.z.
|
|
1194
|
+
module_address: import_zod12.z.enum(INITIA_VAULT_MODULE_ADDRESSES),
|
|
1166
1195
|
module_name: import_zod12.z.literal("lock_staking")
|
|
1167
1196
|
});
|
|
1168
1197
|
var zMsgExtendLiquidity = zMsgMoveExecute.extend({
|
|
1169
1198
|
function_name: import_zod12.z.literal("extend"),
|
|
1170
|
-
module_address: import_zod12.z.
|
|
1199
|
+
module_address: import_zod12.z.enum(INITIA_VAULT_MODULE_ADDRESSES),
|
|
1171
1200
|
module_name: import_zod12.z.literal("lock_staking")
|
|
1172
1201
|
});
|
|
1173
1202
|
var zMsgMergeLiquidity = zMsgMoveExecute.extend({
|
|
1174
1203
|
function_name: import_zod12.z.literal("batch_extend"),
|
|
1175
|
-
module_address: import_zod12.z.
|
|
1204
|
+
module_address: import_zod12.z.enum(INITIA_VAULT_MODULE_ADDRESSES),
|
|
1176
1205
|
module_name: import_zod12.z.literal("lock_staking")
|
|
1177
1206
|
});
|
|
1178
1207
|
var zMsgWithdrawLiquidity = zMsgMoveExecute.extend({
|
|
@@ -1192,52 +1221,52 @@ var zMsgStableswapProvideLiquidity = zMsgMoveExecute.extend({
|
|
|
1192
1221
|
});
|
|
1193
1222
|
var zMsgUsernameSetName = zMsgMoveExecute.extend({
|
|
1194
1223
|
function_name: import_zod12.z.literal("set_name"),
|
|
1195
|
-
module_address: import_zod12.z.
|
|
1224
|
+
module_address: import_zod12.z.enum(USERNAME_MODULE_ADDRESSES),
|
|
1196
1225
|
module_name: import_zod12.z.literal("usernames")
|
|
1197
1226
|
});
|
|
1198
1227
|
var zMsgUsernameUnsetName = zMsgMoveExecute.extend({
|
|
1199
1228
|
function_name: import_zod12.z.literal("unset_name"),
|
|
1200
|
-
module_address: import_zod12.z.
|
|
1229
|
+
module_address: import_zod12.z.enum(USERNAME_MODULE_ADDRESSES),
|
|
1201
1230
|
module_name: import_zod12.z.literal("usernames")
|
|
1202
1231
|
});
|
|
1203
1232
|
var zMsgUsernameExtendExpiration = zMsgMoveExecute.extend({
|
|
1204
1233
|
function_name: import_zod12.z.literal("extend_expiration"),
|
|
1205
|
-
module_address: import_zod12.z.
|
|
1234
|
+
module_address: import_zod12.z.enum(USERNAME_MODULE_ADDRESSES),
|
|
1206
1235
|
module_name: import_zod12.z.literal("usernames")
|
|
1207
1236
|
});
|
|
1208
1237
|
var zMsgClammIncreaseLiquidity = zMsgMoveExecute.extend({
|
|
1209
1238
|
function_name: import_zod12.z.literal("increase_liquidity"),
|
|
1210
|
-
module_address: import_zod12.z.
|
|
1239
|
+
module_address: import_zod12.z.enum(CLAMM_MODULE_ADDRESSES),
|
|
1211
1240
|
module_name: import_zod12.z.literal("scripts")
|
|
1212
1241
|
});
|
|
1213
1242
|
var zMsgClammRemoveLiquidity = zMsgMoveExecute.extend({
|
|
1214
1243
|
function_name: import_zod12.z.literal("remove_liquidity"),
|
|
1215
|
-
module_address: import_zod12.z.
|
|
1244
|
+
module_address: import_zod12.z.enum(CLAMM_MODULE_ADDRESSES),
|
|
1216
1245
|
module_name: import_zod12.z.literal("scripts")
|
|
1217
1246
|
});
|
|
1218
1247
|
var zMsgClammCollectFees = zMsgMoveExecute.extend({
|
|
1219
1248
|
function_name: import_zod12.z.literal("collect_fees"),
|
|
1220
|
-
module_address: import_zod12.z.
|
|
1249
|
+
module_address: import_zod12.z.enum(CLAMM_MODULE_ADDRESSES),
|
|
1221
1250
|
module_name: import_zod12.z.literal("scripts")
|
|
1222
1251
|
});
|
|
1223
1252
|
var zMsgClammUnstakeThenWithdraw = zMsgMoveExecute.extend({
|
|
1224
1253
|
function_name: import_zod12.z.literal("unstake_then_withdraw"),
|
|
1225
|
-
module_address: import_zod12.z.
|
|
1254
|
+
module_address: import_zod12.z.enum(CLAMM_FARMING_MODULE_ADDRESSES),
|
|
1226
1255
|
module_name: import_zod12.z.literal("farming")
|
|
1227
1256
|
});
|
|
1228
1257
|
var zMsgClammStakeEntry = zMsgMoveExecute.extend({
|
|
1229
1258
|
function_name: import_zod12.z.literal("stake_entry"),
|
|
1230
|
-
module_address: import_zod12.z.
|
|
1259
|
+
module_address: import_zod12.z.enum(CLAMM_FARMING_MODULE_ADDRESSES),
|
|
1231
1260
|
module_name: import_zod12.z.literal("farming")
|
|
1232
1261
|
});
|
|
1233
1262
|
var zMsgClammStakeTokenToAll = zMsgMoveExecute.extend({
|
|
1234
1263
|
function_name: import_zod12.z.literal("stake_token_to_all_viable_incentives"),
|
|
1235
|
-
module_address: import_zod12.z.
|
|
1264
|
+
module_address: import_zod12.z.enum(CLAMM_FARMING_MODULE_ADDRESSES),
|
|
1236
1265
|
module_name: import_zod12.z.literal("farming")
|
|
1237
1266
|
});
|
|
1238
1267
|
var zMsgClammClaimTokenReward = zMsgMoveExecute.extend({
|
|
1239
1268
|
function_name: import_zod12.z.literal("claim_token_reward_entry"),
|
|
1240
|
-
module_address: import_zod12.z.
|
|
1269
|
+
module_address: import_zod12.z.enum(CLAMM_FARMING_MODULE_ADDRESSES),
|
|
1241
1270
|
module_name: import_zod12.z.literal("farming")
|
|
1242
1271
|
});
|
|
1243
1272
|
|
|
@@ -2850,10 +2879,10 @@ var clammIncreaseLiquidityDecoder = {
|
|
|
2850
2879
|
check: (message, _log) => zMsgClammIncreaseLiquidity.safeParse(message).success,
|
|
2851
2880
|
decode: async (message, log, apiClient, _txResponse, _vm) => {
|
|
2852
2881
|
const parsed = zMsgClammIncreaseLiquidity.parse(message);
|
|
2853
|
-
const { sender } = parsed;
|
|
2882
|
+
const { module_address, sender } = parsed;
|
|
2854
2883
|
const event = findMoveEvent(
|
|
2855
2884
|
log.events,
|
|
2856
|
-
`${
|
|
2885
|
+
`${module_address}::pool::IncreaseLiquidityEvent`,
|
|
2857
2886
|
zClammIncreaseLiquidityEvent
|
|
2858
2887
|
);
|
|
2859
2888
|
if (!event) {
|
|
@@ -2889,10 +2918,10 @@ var clammRemoveLiquidityDecoder = {
|
|
|
2889
2918
|
check: (message, _log) => zMsgClammRemoveLiquidity.safeParse(message).success,
|
|
2890
2919
|
decode: async (message, log, apiClient, _txResponse, _vm) => {
|
|
2891
2920
|
const parsed = zMsgClammRemoveLiquidity.parse(message);
|
|
2892
|
-
const { sender } = parsed;
|
|
2921
|
+
const { module_address, sender } = parsed;
|
|
2893
2922
|
const event = findMoveEvent(
|
|
2894
2923
|
log.events,
|
|
2895
|
-
`${
|
|
2924
|
+
`${module_address}::pool::RemoveLiquidityEvent`,
|
|
2896
2925
|
zClammRemoveLiquidityEvent
|
|
2897
2926
|
);
|
|
2898
2927
|
if (!event) {
|
|
@@ -2928,10 +2957,10 @@ var clammCollectFeesDecoder = {
|
|
|
2928
2957
|
check: (message, _log) => zMsgClammCollectFees.safeParse(message).success,
|
|
2929
2958
|
decode: async (message, log, apiClient, _txResponse, _vm) => {
|
|
2930
2959
|
const parsed = zMsgClammCollectFees.parse(message);
|
|
2931
|
-
const { sender } = parsed;
|
|
2960
|
+
const { module_address, sender } = parsed;
|
|
2932
2961
|
const event = findMoveEvent(
|
|
2933
2962
|
log.events,
|
|
2934
|
-
`${
|
|
2963
|
+
`${module_address}::pool::CollectFeesEvent`,
|
|
2935
2964
|
zClammCollectFeesEvent
|
|
2936
2965
|
);
|
|
2937
2966
|
const withdrawEvents = findAllMoveEvents(
|
|
@@ -2968,10 +2997,10 @@ var clammUnstakeThenWithdrawDecoder = {
|
|
|
2968
2997
|
check: (message, _log) => zMsgClammUnstakeThenWithdraw.safeParse(message).success,
|
|
2969
2998
|
decode: async (message, log, apiClient, _txResponse, _vm) => {
|
|
2970
2999
|
const parsed = zMsgClammUnstakeThenWithdraw.parse(message);
|
|
2971
|
-
const { sender } = parsed;
|
|
3000
|
+
const { module_address, sender } = parsed;
|
|
2972
3001
|
const unstakeEvent = findMoveEvent(
|
|
2973
3002
|
log.events,
|
|
2974
|
-
`${
|
|
3003
|
+
`${module_address}::farming::UnstakeEvent`,
|
|
2975
3004
|
zClammUnstakeEvent
|
|
2976
3005
|
);
|
|
2977
3006
|
if (!unstakeEvent) {
|
|
@@ -2979,7 +3008,7 @@ var clammUnstakeThenWithdrawDecoder = {
|
|
|
2979
3008
|
}
|
|
2980
3009
|
const claimEvents = findAllMoveEvents(
|
|
2981
3010
|
log.events,
|
|
2982
|
-
`${
|
|
3011
|
+
`${module_address}::farming::ClaimTokenEvent`,
|
|
2983
3012
|
zClammClaimTokenEvent
|
|
2984
3013
|
);
|
|
2985
3014
|
const claimedRewards = await Promise.all(
|
|
@@ -3009,10 +3038,10 @@ var clammUnstakeThenWithdrawDecoder = {
|
|
|
3009
3038
|
};
|
|
3010
3039
|
var decodeClammStake = async (message, log, _apiClient, _txResponse, _vm) => {
|
|
3011
3040
|
const parsed = zMsgMoveExecute.parse(message);
|
|
3012
|
-
const { sender } = parsed;
|
|
3041
|
+
const { module_address, sender } = parsed;
|
|
3013
3042
|
const stakeEvents = findAllMoveEvents(
|
|
3014
3043
|
log.events,
|
|
3015
|
-
`${
|
|
3044
|
+
`${module_address}::farming::StakeEvent`,
|
|
3016
3045
|
zClammStakeEvent
|
|
3017
3046
|
);
|
|
3018
3047
|
if (stakeEvents.length === 0) {
|
|
@@ -3043,10 +3072,10 @@ var clammClaimTokenRewardDecoder = {
|
|
|
3043
3072
|
check: (message, _log) => zMsgClammClaimTokenReward.safeParse(message).success,
|
|
3044
3073
|
decode: async (message, log, apiClient, _txResponse, _vm) => {
|
|
3045
3074
|
const parsed = zMsgClammClaimTokenReward.parse(message);
|
|
3046
|
-
const { sender } = parsed;
|
|
3075
|
+
const { module_address, sender } = parsed;
|
|
3047
3076
|
const claimEvents = findAllMoveEvents(
|
|
3048
3077
|
log.events,
|
|
3049
|
-
`${
|
|
3078
|
+
`${module_address}::farming::ClaimTokenEvent`,
|
|
3050
3079
|
zClammClaimTokenEvent
|
|
3051
3080
|
);
|
|
3052
3081
|
if (claimEvents.length === 0) {
|
|
@@ -3078,21 +3107,28 @@ var clammClaimTokenRewardDecoder = {
|
|
|
3078
3107
|
var clammProvideConcentratedDecoder = {
|
|
3079
3108
|
check: (message, log) => {
|
|
3080
3109
|
if (!zMsgMoveScript.safeParse(message).success) return false;
|
|
3081
|
-
const
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3110
|
+
for (const addr of CLAMM_MODULE_ADDRESSES) {
|
|
3111
|
+
const event = findMoveEvent(
|
|
3112
|
+
log.events,
|
|
3113
|
+
`${addr}::pool::IncreaseLiquidityEvent`,
|
|
3114
|
+
zClammIncreaseLiquidityEvent
|
|
3115
|
+
);
|
|
3116
|
+
if (event) return true;
|
|
3117
|
+
}
|
|
3118
|
+
return false;
|
|
3087
3119
|
},
|
|
3088
3120
|
decode: async (message, log, apiClient, _txResponse, _vm) => {
|
|
3089
3121
|
const parsed = zMsgMoveScript.parse(message);
|
|
3090
3122
|
const { sender } = parsed;
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3123
|
+
let event = null;
|
|
3124
|
+
for (const addr of CLAMM_MODULE_ADDRESSES) {
|
|
3125
|
+
event = findMoveEvent(
|
|
3126
|
+
log.events,
|
|
3127
|
+
`${addr}::pool::IncreaseLiquidityEvent`,
|
|
3128
|
+
zClammIncreaseLiquidityEvent
|
|
3129
|
+
);
|
|
3130
|
+
if (event) break;
|
|
3131
|
+
}
|
|
3096
3132
|
if (!event) {
|
|
3097
3133
|
throw new Error("IncreaseLiquidityEvent not found");
|
|
3098
3134
|
}
|
|
@@ -3317,6 +3353,62 @@ var depositStakeLiquidityDecoder = {
|
|
|
3317
3353
|
return decodedMessage;
|
|
3318
3354
|
}
|
|
3319
3355
|
};
|
|
3356
|
+
var provideStakeLiquidityDecoder = {
|
|
3357
|
+
check: (message, _log) => zMsgProvideStakeLiquidity.safeParse(message).success,
|
|
3358
|
+
decode: async (message, log, apiClient, _txResponse) => {
|
|
3359
|
+
const parsed = zMsgProvideStakeLiquidity.parse(message);
|
|
3360
|
+
const { sender } = parsed;
|
|
3361
|
+
const provideEvent = findMoveEvent(
|
|
3362
|
+
log.events,
|
|
3363
|
+
"0x1::dex::ProvideEvent",
|
|
3364
|
+
zProvideEvent
|
|
3365
|
+
);
|
|
3366
|
+
if (!provideEvent) {
|
|
3367
|
+
throw new Error("Provide event not found");
|
|
3368
|
+
}
|
|
3369
|
+
const delegateEvent = log.events.find((event) => event.type === "delegate");
|
|
3370
|
+
const validatorAddress = delegateEvent?.attributes.find(
|
|
3371
|
+
(attr) => attr.key === "validator"
|
|
3372
|
+
)?.value;
|
|
3373
|
+
if (!validatorAddress) {
|
|
3374
|
+
throw new Error("Validator is missing from the delegate event");
|
|
3375
|
+
}
|
|
3376
|
+
const [denomA, denomB, liquidityDenom, validatorData] = await Promise.all([
|
|
3377
|
+
apiClient.findDenomFromMetadataAddr(provideEvent.coin_a),
|
|
3378
|
+
apiClient.findDenomFromMetadataAddr(provideEvent.coin_b),
|
|
3379
|
+
apiClient.findDenomFromMetadataAddr(provideEvent.liquidity_token),
|
|
3380
|
+
apiClient.findValidator(validatorAddress)
|
|
3381
|
+
]);
|
|
3382
|
+
if (!denomA) {
|
|
3383
|
+
throw new Error(`Denom A not found for coin ${provideEvent.coin_a}`);
|
|
3384
|
+
}
|
|
3385
|
+
if (!denomB) {
|
|
3386
|
+
throw new Error(`Denom B not found for coin ${provideEvent.coin_b}`);
|
|
3387
|
+
}
|
|
3388
|
+
if (!liquidityDenom) {
|
|
3389
|
+
throw new Error(
|
|
3390
|
+
`Liquidity denom not found for token ${provideEvent.liquidity_token}`
|
|
3391
|
+
);
|
|
3392
|
+
}
|
|
3393
|
+
const decodedMessage = {
|
|
3394
|
+
action: "provide_stake_liquidity",
|
|
3395
|
+
data: {
|
|
3396
|
+
amountA: provideEvent.coin_a_amount,
|
|
3397
|
+
amountB: provideEvent.coin_b_amount,
|
|
3398
|
+
denomA,
|
|
3399
|
+
denomB,
|
|
3400
|
+
from: sender,
|
|
3401
|
+
liquidity: provideEvent.liquidity,
|
|
3402
|
+
liquidityDenom,
|
|
3403
|
+
validator: validatorData,
|
|
3404
|
+
validatorAddress
|
|
3405
|
+
},
|
|
3406
|
+
isIbc: false,
|
|
3407
|
+
isOp: false
|
|
3408
|
+
};
|
|
3409
|
+
return decodedMessage;
|
|
3410
|
+
}
|
|
3411
|
+
};
|
|
3320
3412
|
var depositStakeLockLiquidityDecoder = {
|
|
3321
3413
|
check: (message, _log) => zMsgDepositStakeLockLiquidity.safeParse(message).success,
|
|
3322
3414
|
decode: async (message, log, apiClient, txResponse) => {
|
|
@@ -3337,10 +3429,13 @@ var depositStakeLockLiquidityDecoder = {
|
|
|
3337
3429
|
if (!validatorAddress) {
|
|
3338
3430
|
throw new Error("Validator is missing from the delegate event");
|
|
3339
3431
|
}
|
|
3340
|
-
const depositDelegationEvent =
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3432
|
+
const depositDelegationEvent = INITIA_VAULT_MODULE_ADDRESSES.reduce(
|
|
3433
|
+
(found, addr) => found ?? findMoveEvent(
|
|
3434
|
+
log.events,
|
|
3435
|
+
`${addr}::lock_staking::DepositDelegationEvent`,
|
|
3436
|
+
zDepositDelegationEvent
|
|
3437
|
+
),
|
|
3438
|
+
null
|
|
3344
3439
|
);
|
|
3345
3440
|
if (!depositDelegationEvent) {
|
|
3346
3441
|
throw new Error("DepositDelegationEvent not found");
|
|
@@ -3407,7 +3502,7 @@ var provideDelegateLiquidityDecoder = {
|
|
|
3407
3502
|
}
|
|
3408
3503
|
const depositDelegationEvent = findMoveEvent(
|
|
3409
3504
|
log.events,
|
|
3410
|
-
`${
|
|
3505
|
+
`${parsed.module_address}::lock_staking::DepositDelegationEvent`,
|
|
3411
3506
|
zDepositDelegationEvent
|
|
3412
3507
|
);
|
|
3413
3508
|
if (!depositDelegationEvent) {
|
|
@@ -3457,10 +3552,10 @@ var extendLiquidityDecoder = {
|
|
|
3457
3552
|
check: (message, _log) => zMsgExtendLiquidity.safeParse(message).success,
|
|
3458
3553
|
decode: async (message, log, apiClient, _txResponse) => {
|
|
3459
3554
|
const parsed = zMsgExtendLiquidity.parse(message);
|
|
3460
|
-
const { sender } = parsed;
|
|
3555
|
+
const { module_address, sender } = parsed;
|
|
3461
3556
|
const withdrawDelegationEvent = findMoveEvent(
|
|
3462
3557
|
log.events,
|
|
3463
|
-
`${
|
|
3558
|
+
`${module_address}::lock_staking::WithdrawDelegationEvent`,
|
|
3464
3559
|
zWithdrawDelegationEvent
|
|
3465
3560
|
);
|
|
3466
3561
|
if (!withdrawDelegationEvent) {
|
|
@@ -3468,7 +3563,7 @@ var extendLiquidityDecoder = {
|
|
|
3468
3563
|
}
|
|
3469
3564
|
const depositDelegationEvent = findMoveEvent(
|
|
3470
3565
|
log.events,
|
|
3471
|
-
`${
|
|
3566
|
+
`${module_address}::lock_staking::DepositDelegationEvent`,
|
|
3472
3567
|
zDepositDelegationEvent
|
|
3473
3568
|
);
|
|
3474
3569
|
if (!depositDelegationEvent) {
|
|
@@ -3504,10 +3599,10 @@ var mergeLiquidityDecoder = {
|
|
|
3504
3599
|
check: (message, _log) => zMsgMergeLiquidity.safeParse(message).success,
|
|
3505
3600
|
decode: async (message, log, apiClient, _txResponse) => {
|
|
3506
3601
|
const parsed = zMsgMergeLiquidity.parse(message);
|
|
3507
|
-
const { sender } = parsed;
|
|
3602
|
+
const { module_address, sender } = parsed;
|
|
3508
3603
|
const withdrawDelegationEvents = findAllMoveEvents(
|
|
3509
3604
|
log.events,
|
|
3510
|
-
`${
|
|
3605
|
+
`${module_address}::lock_staking::WithdrawDelegationEvent`,
|
|
3511
3606
|
zWithdrawDelegationEvent
|
|
3512
3607
|
);
|
|
3513
3608
|
if (withdrawDelegationEvents.length === 0) {
|
|
@@ -3523,7 +3618,7 @@ var mergeLiquidityDecoder = {
|
|
|
3523
3618
|
);
|
|
3524
3619
|
const depositDelegationEvent = findMoveEvent(
|
|
3525
3620
|
log.events,
|
|
3526
|
-
`${
|
|
3621
|
+
`${module_address}::lock_staking::DepositDelegationEvent`,
|
|
3527
3622
|
zDepositDelegationEvent
|
|
3528
3623
|
);
|
|
3529
3624
|
if (!depositDelegationEvent) {
|
|
@@ -4055,10 +4150,10 @@ var delegateLockedDecoder = {
|
|
|
4055
4150
|
if (!parsed.success) {
|
|
4056
4151
|
throw new Error("Invalid delegate locked message");
|
|
4057
4152
|
}
|
|
4058
|
-
const { sender } = parsed.data;
|
|
4153
|
+
const { module_address, sender } = parsed.data;
|
|
4059
4154
|
const delegateLockedEvent = findMoveEvent(
|
|
4060
4155
|
log.events,
|
|
4061
|
-
`${
|
|
4156
|
+
`${module_address}::lock_staking::DepositDelegationEvent`,
|
|
4062
4157
|
zDepositDelegationEvent
|
|
4063
4158
|
);
|
|
4064
4159
|
if (!delegateLockedEvent) {
|
|
@@ -4101,10 +4196,10 @@ var undelegateLockedDecoder = {
|
|
|
4101
4196
|
if (!parsed.success) {
|
|
4102
4197
|
throw new Error("Invalid undelegate locked message");
|
|
4103
4198
|
}
|
|
4104
|
-
const { sender } = parsed.data;
|
|
4199
|
+
const { module_address, sender } = parsed.data;
|
|
4105
4200
|
const undelegateLockedEvent = findMoveEvent(
|
|
4106
4201
|
log.events,
|
|
4107
|
-
`${
|
|
4202
|
+
`${module_address}::lock_staking::WithdrawDelegationEvent`,
|
|
4108
4203
|
zWithdrawDelegationEvent
|
|
4109
4204
|
);
|
|
4110
4205
|
if (!undelegateLockedEvent) {
|
|
@@ -4147,10 +4242,10 @@ var redelegateLockedDecoder = {
|
|
|
4147
4242
|
if (!parsed.success) {
|
|
4148
4243
|
throw new Error("Invalid redelegate locked message");
|
|
4149
4244
|
}
|
|
4150
|
-
const { sender } = parsed.data;
|
|
4245
|
+
const { module_address, sender } = parsed.data;
|
|
4151
4246
|
const withdrawDelegationEvent = findMoveEvent(
|
|
4152
4247
|
log.events,
|
|
4153
|
-
`${
|
|
4248
|
+
`${module_address}::lock_staking::WithdrawDelegationEvent`,
|
|
4154
4249
|
zWithdrawDelegationEvent
|
|
4155
4250
|
);
|
|
4156
4251
|
if (!withdrawDelegationEvent) {
|
|
@@ -4160,7 +4255,7 @@ var redelegateLockedDecoder = {
|
|
|
4160
4255
|
}
|
|
4161
4256
|
const delegateLockedEvent = findMoveEvent(
|
|
4162
4257
|
log.events,
|
|
4163
|
-
`${
|
|
4258
|
+
`${module_address}::lock_staking::DepositDelegationEvent`,
|
|
4164
4259
|
zDepositDelegationEvent
|
|
4165
4260
|
);
|
|
4166
4261
|
if (!delegateLockedEvent) {
|
|
@@ -4323,7 +4418,7 @@ var vipClaimEsinitDecoder = {
|
|
|
4323
4418
|
check: (message, _log) => zMsgVipClaimEsinit.safeParse(message).success,
|
|
4324
4419
|
decode: async (message, log, apiClient, _txResponse) => {
|
|
4325
4420
|
const parsed = zMsgVipClaimEsinit.parse(message);
|
|
4326
|
-
const { sender } = parsed;
|
|
4421
|
+
const { module_address, sender } = parsed;
|
|
4327
4422
|
const denom = "uinit";
|
|
4328
4423
|
const depositEvent = findMoveEvent(
|
|
4329
4424
|
log.events,
|
|
@@ -4332,7 +4427,7 @@ var vipClaimEsinitDecoder = {
|
|
|
4332
4427
|
);
|
|
4333
4428
|
const userVestingCreateEvent = findMoveEvent(
|
|
4334
4429
|
log.events,
|
|
4335
|
-
`${
|
|
4430
|
+
`${module_address}::vesting::UserVestingCreateEvent`,
|
|
4336
4431
|
zUserVestingCreateEvent
|
|
4337
4432
|
);
|
|
4338
4433
|
if (!userVestingCreateEvent) {
|
|
@@ -4378,10 +4473,10 @@ var vipGaugeVoteDecoder = {
|
|
|
4378
4473
|
check: (message, _log) => zMsgVipGaugeVote.safeParse(message).success,
|
|
4379
4474
|
decode: async (message, log, apiClient, _txResponse) => {
|
|
4380
4475
|
const parsed = zMsgVipGaugeVote.parse(message);
|
|
4381
|
-
const { sender } = parsed;
|
|
4476
|
+
const { module_address, sender } = parsed;
|
|
4382
4477
|
const voteEvent = findMoveEvent(
|
|
4383
4478
|
log.events,
|
|
4384
|
-
`${
|
|
4479
|
+
`${module_address}::weight_vote::VoteEvent`,
|
|
4385
4480
|
zVoteEvent
|
|
4386
4481
|
);
|
|
4387
4482
|
if (!voteEvent) {
|
|
@@ -4422,10 +4517,10 @@ var vipLockStakeDecoder = {
|
|
|
4422
4517
|
if (!parsed.success) {
|
|
4423
4518
|
throw new Error("Invalid VIP lock stake message");
|
|
4424
4519
|
}
|
|
4425
|
-
const { sender } = parsed.data;
|
|
4520
|
+
const { module_address, sender } = parsed.data;
|
|
4426
4521
|
const depositDelegationEvent = findMoveEvent(
|
|
4427
4522
|
log.events,
|
|
4428
|
-
`${
|
|
4523
|
+
`${module_address}::lock_staking::DepositDelegationEvent`,
|
|
4429
4524
|
zDepositDelegationEvent
|
|
4430
4525
|
);
|
|
4431
4526
|
if (!depositDelegationEvent) {
|
|
@@ -6047,6 +6142,7 @@ var cosmosMoveMessageDecoders = [
|
|
|
6047
6142
|
depositStakeLiquidityDecoder,
|
|
6048
6143
|
depositStakeLockLiquidityDecoder,
|
|
6049
6144
|
provideDelegateLiquidityDecoder,
|
|
6145
|
+
provideStakeLiquidityDecoder,
|
|
6050
6146
|
dexSwapDecoder,
|
|
6051
6147
|
extendLiquidityDecoder,
|
|
6052
6148
|
finalizeTokenWithdrawalDecoder,
|