@typus/typus-perp-sdk 1.0.61-ut-upgrade → 1.0.62

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.
@@ -105,12 +105,12 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
105
105
  return to.concat(ar || Array.prototype.slice.call(from));
106
106
  };
107
107
  Object.defineProperty(exports, "__esModule", { value: true });
108
- exports.UpdateUnlockCountdownTsMsEvent = exports.UpdateSpotConfigEvent = exports.UpdateMarginConfigEvent = exports.UpdateLiquidityValueEvent = exports.UpdateBorrowInfoEvent = exports.TokenPool = exports.SwapEvent = exports.SuspendTokenPoolEvent = exports.SuspendPoolEvent = exports.State = exports.StartRemoveLiquidityTokenProcessEvent = exports.SpotConfig = exports.ResumeTokenPoolEvent = exports.ResumePoolEvent = exports.RemoveLiquidityTokenProcess = exports.Registry = exports.RedeemEvent = exports.NewLiquidityPoolEvent = exports.MintLpEvent = exports.MarginConfig = exports.ManagerFlashRepayLiquidityEvent = exports.ManagerFlashRemoveLiquidityEvent = exports.LiquidityPoolInfo = exports.LiquidityPool = exports.DeactivatingShares = exports.Config = exports.CompleteRemoveLiquidityTokenProcessEvent = exports.BurnLpEvent = exports.AddLiquidityTokenEvent = void 0;
108
+ exports.WithdrawLendingEvent = exports.UpdateSpotConfigEvent = exports.UpdateMarginConfigEvent = exports.UpdateLiquidityValueEvent = exports.UpdateBorrowInfoEvent = exports.TokenPool = exports.SwapEvent = exports.SuspendTokenPoolEvent = exports.SuspendPoolEvent = exports.State = exports.StartRemoveLiquidityTokenProcessEvent = exports.SpotConfig = exports.ResumeTokenPoolEvent = exports.ResumePoolEvent = exports.RemoveLiquidityTokenProcess = exports.Registry = exports.NewLiquidityPoolEvent = exports.MintLpEvent = exports.MarginConfig = exports.ManagerFlashRepayLiquidityEvent = exports.ManagerFlashRemoveLiquidityEvent = exports.LiquidityPoolInfo = exports.LiquidityPool = exports.DepositLendingEvent = exports.Config = exports.CompleteRemoveLiquidityTokenProcessEvent = exports.BurnLpEvent = exports.AddLiquidityTokenEvent = void 0;
109
109
  exports.isAddLiquidityTokenEvent = isAddLiquidityTokenEvent;
110
110
  exports.isBurnLpEvent = isBurnLpEvent;
111
111
  exports.isCompleteRemoveLiquidityTokenProcessEvent = isCompleteRemoveLiquidityTokenProcessEvent;
112
112
  exports.isConfig = isConfig;
113
- exports.isDeactivatingShares = isDeactivatingShares;
113
+ exports.isDepositLendingEvent = isDepositLendingEvent;
114
114
  exports.isLiquidityPool = isLiquidityPool;
115
115
  exports.isLiquidityPoolInfo = isLiquidityPoolInfo;
116
116
  exports.isManagerFlashRemoveLiquidityEvent = isManagerFlashRemoveLiquidityEvent;
@@ -118,7 +118,6 @@ exports.isManagerFlashRepayLiquidityEvent = isManagerFlashRepayLiquidityEvent;
118
118
  exports.isMarginConfig = isMarginConfig;
119
119
  exports.isMintLpEvent = isMintLpEvent;
120
120
  exports.isNewLiquidityPoolEvent = isNewLiquidityPoolEvent;
121
- exports.isRedeemEvent = isRedeemEvent;
122
121
  exports.isRegistry = isRegistry;
123
122
  exports.isRemoveLiquidityTokenProcess = isRemoveLiquidityTokenProcess;
124
123
  exports.isResumePoolEvent = isResumePoolEvent;
@@ -134,14 +133,13 @@ exports.isUpdateBorrowInfoEvent = isUpdateBorrowInfoEvent;
134
133
  exports.isUpdateLiquidityValueEvent = isUpdateLiquidityValueEvent;
135
134
  exports.isUpdateMarginConfigEvent = isUpdateMarginConfigEvent;
136
135
  exports.isUpdateSpotConfigEvent = isUpdateSpotConfigEvent;
137
- exports.isUpdateUnlockCountdownTsMsEvent = isUpdateUnlockCountdownTsMsEvent;
136
+ exports.isWithdrawLendingEvent = isWithdrawLendingEvent;
138
137
  var reified = __importStar(require("../../_framework/reified"));
139
138
  var structs_1 = require("../../_dependencies/source/0x1/type-name/structs");
140
- var structs_2 = require("../../_dependencies/source/0x2/balance/structs");
141
- var structs_3 = require("../../_dependencies/source/0x2/object/structs");
139
+ var structs_2 = require("../../_dependencies/source/0x2/object/structs");
142
140
  var reified_1 = require("../../_framework/reified");
143
141
  var util_1 = require("../../_framework/util");
144
- var structs_4 = require("../escrow/structs");
142
+ var structs_3 = require("../escrow/structs");
145
143
  var index_1 = require("../index");
146
144
  var bcs_1 = require("@mysten/sui/bcs");
147
145
  var utils_1 = require("@mysten/sui/utils");
@@ -859,157 +857,182 @@ var Config = /** @class */ (function () {
859
857
  return Config;
860
858
  }());
861
859
  exports.Config = Config;
862
- /* ============================== DeactivatingShares =============================== */
863
- function isDeactivatingShares(type) {
860
+ /* ============================== DepositLendingEvent =============================== */
861
+ function isDepositLendingEvent(type) {
864
862
  type = (0, util_1.compressSuiType)(type);
865
- return type.startsWith("".concat(index_1.PKG_V1, "::lp_pool::DeactivatingShares") + "<");
863
+ return type === "".concat(index_1.PKG_V1, "::lp_pool::DepositLendingEvent");
866
864
  }
867
- var DeactivatingShares = /** @class */ (function () {
868
- function DeactivatingShares(typeArgs, fields) {
865
+ var DepositLendingEvent = /** @class */ (function () {
866
+ function DepositLendingEvent(typeArgs, fields) {
869
867
  this.__StructClass = true;
870
- this.$typeName = DeactivatingShares.$typeName;
871
- this.$isPhantom = DeactivatingShares.$isPhantom;
872
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([DeactivatingShares.$typeName], __read(typeArgs), false));
868
+ this.$typeName = DepositLendingEvent.$typeName;
869
+ this.$isPhantom = DepositLendingEvent.$isPhantom;
870
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([DepositLendingEvent.$typeName], __read(typeArgs), false));
873
871
  this.$typeArgs = typeArgs;
874
- this.balance = fields.balance;
875
- this.redeemTsMs = fields.redeemTsMs;
876
- this.unlockTsMs = fields.unlockTsMs;
872
+ this.index = fields.index;
873
+ this.lendingIndex = fields.lendingIndex;
874
+ this.cTokenType = fields.cTokenType;
875
+ this.depositAmount = fields.depositAmount;
876
+ this.mintedMarketCoinAmount = fields.mintedMarketCoinAmount;
877
+ this.latestLendingAmount = fields.latestLendingAmount;
878
+ this.latestMarketCoinAmount = fields.latestMarketCoinAmount;
879
+ this.latestReservedAmount = fields.latestReservedAmount;
880
+ this.latestLiquidityAmount = fields.latestLiquidityAmount;
877
881
  this.u64Padding = fields.u64Padding;
878
882
  }
879
- DeactivatingShares.reified = function (TOKEN) {
883
+ DepositLendingEvent.reified = function () {
880
884
  var _this = this;
881
885
  return {
882
- typeName: DeactivatingShares.$typeName,
883
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([DeactivatingShares.$typeName], [(0, reified_1.extractType)(TOKEN)], false)),
884
- typeArgs: [(0, reified_1.extractType)(TOKEN)],
885
- isPhantom: DeactivatingShares.$isPhantom,
886
- reifiedTypeArgs: [TOKEN],
887
- fromFields: function (fields) { return DeactivatingShares.fromFields(TOKEN, fields); },
888
- fromFieldsWithTypes: function (item) { return DeactivatingShares.fromFieldsWithTypes(TOKEN, item); },
889
- fromBcs: function (data) { return DeactivatingShares.fromBcs(TOKEN, data); },
890
- bcs: DeactivatingShares.bcs,
891
- fromJSONField: function (field) { return DeactivatingShares.fromJSONField(TOKEN, field); },
892
- fromJSON: function (json) { return DeactivatingShares.fromJSON(TOKEN, json); },
893
- fromSuiParsedData: function (content) { return DeactivatingShares.fromSuiParsedData(TOKEN, content); },
894
- fromSuiObjectData: function (content) { return DeactivatingShares.fromSuiObjectData(TOKEN, content); },
886
+ typeName: DepositLendingEvent.$typeName,
887
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([DepositLendingEvent.$typeName], [], false)),
888
+ typeArgs: [],
889
+ isPhantom: DepositLendingEvent.$isPhantom,
890
+ reifiedTypeArgs: [],
891
+ fromFields: function (fields) { return DepositLendingEvent.fromFields(fields); },
892
+ fromFieldsWithTypes: function (item) { return DepositLendingEvent.fromFieldsWithTypes(item); },
893
+ fromBcs: function (data) { return DepositLendingEvent.fromBcs(data); },
894
+ bcs: DepositLendingEvent.bcs,
895
+ fromJSONField: function (field) { return DepositLendingEvent.fromJSONField(field); },
896
+ fromJSON: function (json) { return DepositLendingEvent.fromJSON(json); },
897
+ fromSuiParsedData: function (content) { return DepositLendingEvent.fromSuiParsedData(content); },
898
+ fromSuiObjectData: function (content) { return DepositLendingEvent.fromSuiObjectData(content); },
895
899
  fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
896
- return [2 /*return*/, DeactivatingShares.fetch(client, TOKEN, id)];
900
+ return [2 /*return*/, DepositLendingEvent.fetch(client, id)];
897
901
  }); }); },
898
902
  new: function (fields) {
899
- return new DeactivatingShares([(0, reified_1.extractType)(TOKEN)], fields);
903
+ return new DepositLendingEvent([], fields);
900
904
  },
901
905
  kind: "StructClassReified",
902
906
  };
903
907
  };
904
- Object.defineProperty(DeactivatingShares, "r", {
908
+ Object.defineProperty(DepositLendingEvent, "r", {
905
909
  get: function () {
906
- return DeactivatingShares.reified;
910
+ return DepositLendingEvent.reified();
907
911
  },
908
912
  enumerable: false,
909
913
  configurable: true
910
914
  });
911
- DeactivatingShares.phantom = function (TOKEN) {
912
- return (0, reified_1.phantom)(DeactivatingShares.reified(TOKEN));
915
+ DepositLendingEvent.phantom = function () {
916
+ return (0, reified_1.phantom)(DepositLendingEvent.reified());
913
917
  };
914
- Object.defineProperty(DeactivatingShares, "p", {
918
+ Object.defineProperty(DepositLendingEvent, "p", {
915
919
  get: function () {
916
- return DeactivatingShares.phantom;
920
+ return DepositLendingEvent.phantom();
917
921
  },
918
922
  enumerable: false,
919
923
  configurable: true
920
924
  });
921
- Object.defineProperty(DeactivatingShares, "bcs", {
925
+ Object.defineProperty(DepositLendingEvent, "bcs", {
922
926
  get: function () {
923
- return bcs_1.bcs.struct("DeactivatingShares", {
924
- balance: structs_2.Balance.bcs,
925
- redeem_ts_ms: bcs_1.bcs.u64(),
926
- unlock_ts_ms: bcs_1.bcs.u64(),
927
+ return bcs_1.bcs.struct("DepositLendingEvent", {
928
+ index: bcs_1.bcs.u64(),
929
+ lending_index: bcs_1.bcs.u64(),
930
+ c_token_type: structs_1.TypeName.bcs,
931
+ deposit_amount: bcs_1.bcs.u64(),
932
+ minted_market_coin_amount: bcs_1.bcs.u64(),
933
+ latest_lending_amount: bcs_1.bcs.u64(),
934
+ latest_market_coin_amount: bcs_1.bcs.u64(),
935
+ latest_reserved_amount: bcs_1.bcs.u64(),
936
+ latest_liquidity_amount: bcs_1.bcs.u64(),
927
937
  u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
928
938
  });
929
939
  },
930
940
  enumerable: false,
931
941
  configurable: true
932
942
  });
933
- DeactivatingShares.fromFields = function (typeArg, fields) {
934
- return DeactivatingShares.reified(typeArg).new({
935
- balance: (0, reified_1.decodeFromFields)(structs_2.Balance.reified(typeArg), fields.balance),
936
- redeemTsMs: (0, reified_1.decodeFromFields)("u64", fields.redeem_ts_ms),
937
- unlockTsMs: (0, reified_1.decodeFromFields)("u64", fields.unlock_ts_ms),
943
+ DepositLendingEvent.fromFields = function (fields) {
944
+ return DepositLendingEvent.reified().new({
945
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
946
+ lendingIndex: (0, reified_1.decodeFromFields)("u64", fields.lending_index),
947
+ cTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.c_token_type),
948
+ depositAmount: (0, reified_1.decodeFromFields)("u64", fields.deposit_amount),
949
+ mintedMarketCoinAmount: (0, reified_1.decodeFromFields)("u64", fields.minted_market_coin_amount),
950
+ latestLendingAmount: (0, reified_1.decodeFromFields)("u64", fields.latest_lending_amount),
951
+ latestMarketCoinAmount: (0, reified_1.decodeFromFields)("u64", fields.latest_market_coin_amount),
952
+ latestReservedAmount: (0, reified_1.decodeFromFields)("u64", fields.latest_reserved_amount),
953
+ latestLiquidityAmount: (0, reified_1.decodeFromFields)("u64", fields.latest_liquidity_amount),
938
954
  u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
939
955
  });
940
956
  };
941
- DeactivatingShares.fromFieldsWithTypes = function (typeArg, item) {
942
- if (!isDeactivatingShares(item.type)) {
943
- throw new Error("not a DeactivatingShares type");
957
+ DepositLendingEvent.fromFieldsWithTypes = function (item) {
958
+ if (!isDepositLendingEvent(item.type)) {
959
+ throw new Error("not a DepositLendingEvent type");
944
960
  }
945
- (0, reified_1.assertFieldsWithTypesArgsMatch)(item, [typeArg]);
946
- return DeactivatingShares.reified(typeArg).new({
947
- balance: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.Balance.reified(typeArg), item.fields.balance),
948
- redeemTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.redeem_ts_ms),
949
- unlockTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.unlock_ts_ms),
961
+ return DepositLendingEvent.reified().new({
962
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
963
+ lendingIndex: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.lending_index),
964
+ cTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.c_token_type),
965
+ depositAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.deposit_amount),
966
+ mintedMarketCoinAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.minted_market_coin_amount),
967
+ latestLendingAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.latest_lending_amount),
968
+ latestMarketCoinAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.latest_market_coin_amount),
969
+ latestReservedAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.latest_reserved_amount),
970
+ latestLiquidityAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.latest_liquidity_amount),
950
971
  u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
951
972
  });
952
973
  };
953
- DeactivatingShares.fromBcs = function (typeArg, data) {
954
- return DeactivatingShares.fromFields(typeArg, DeactivatingShares.bcs.parse(data));
974
+ DepositLendingEvent.fromBcs = function (data) {
975
+ return DepositLendingEvent.fromFields(DepositLendingEvent.bcs.parse(data));
955
976
  };
956
- DeactivatingShares.prototype.toJSONField = function () {
977
+ DepositLendingEvent.prototype.toJSONField = function () {
957
978
  return {
958
- balance: this.balance.toJSONField(),
959
- redeemTsMs: this.redeemTsMs.toString(),
960
- unlockTsMs: this.unlockTsMs.toString(),
979
+ index: this.index.toString(),
980
+ lendingIndex: this.lendingIndex.toString(),
981
+ cTokenType: this.cTokenType.toJSONField(),
982
+ depositAmount: this.depositAmount.toString(),
983
+ mintedMarketCoinAmount: this.mintedMarketCoinAmount.toString(),
984
+ latestLendingAmount: this.latestLendingAmount.toString(),
985
+ latestMarketCoinAmount: this.latestMarketCoinAmount.toString(),
986
+ latestReservedAmount: this.latestReservedAmount.toString(),
987
+ latestLiquidityAmount: this.latestLiquidityAmount.toString(),
961
988
  u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
962
989
  };
963
990
  };
964
- DeactivatingShares.prototype.toJSON = function () {
991
+ DepositLendingEvent.prototype.toJSON = function () {
965
992
  return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
966
993
  };
967
- DeactivatingShares.fromJSONField = function (typeArg, field) {
968
- return DeactivatingShares.reified(typeArg).new({
969
- balance: (0, reified_1.decodeFromJSONField)(structs_2.Balance.reified(typeArg), field.balance),
970
- redeemTsMs: (0, reified_1.decodeFromJSONField)("u64", field.redeemTsMs),
971
- unlockTsMs: (0, reified_1.decodeFromJSONField)("u64", field.unlockTsMs),
994
+ DepositLendingEvent.fromJSONField = function (field) {
995
+ return DepositLendingEvent.reified().new({
996
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
997
+ lendingIndex: (0, reified_1.decodeFromJSONField)("u64", field.lendingIndex),
998
+ cTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.cTokenType),
999
+ depositAmount: (0, reified_1.decodeFromJSONField)("u64", field.depositAmount),
1000
+ mintedMarketCoinAmount: (0, reified_1.decodeFromJSONField)("u64", field.mintedMarketCoinAmount),
1001
+ latestLendingAmount: (0, reified_1.decodeFromJSONField)("u64", field.latestLendingAmount),
1002
+ latestMarketCoinAmount: (0, reified_1.decodeFromJSONField)("u64", field.latestMarketCoinAmount),
1003
+ latestReservedAmount: (0, reified_1.decodeFromJSONField)("u64", field.latestReservedAmount),
1004
+ latestLiquidityAmount: (0, reified_1.decodeFromJSONField)("u64", field.latestLiquidityAmount),
972
1005
  u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
973
1006
  });
974
1007
  };
975
- DeactivatingShares.fromJSON = function (typeArg, json) {
976
- if (json.$typeName !== DeactivatingShares.$typeName) {
1008
+ DepositLendingEvent.fromJSON = function (json) {
1009
+ if (json.$typeName !== DepositLendingEvent.$typeName) {
977
1010
  throw new Error("not a WithTwoGenerics json object");
978
1011
  }
979
- (0, reified_1.assertReifiedTypeArgsMatch)((0, util_1.composeSuiType)(DeactivatingShares.$typeName, (0, reified_1.extractType)(typeArg)), json.$typeArgs, [typeArg]);
980
- return DeactivatingShares.fromJSONField(typeArg, json);
1012
+ return DepositLendingEvent.fromJSONField(json);
981
1013
  };
982
- DeactivatingShares.fromSuiParsedData = function (typeArg, content) {
1014
+ DepositLendingEvent.fromSuiParsedData = function (content) {
983
1015
  if (content.dataType !== "moveObject") {
984
1016
  throw new Error("not an object");
985
1017
  }
986
- if (!isDeactivatingShares(content.type)) {
987
- throw new Error("object at ".concat(content.fields.id, " is not a DeactivatingShares object"));
1018
+ if (!isDepositLendingEvent(content.type)) {
1019
+ throw new Error("object at ".concat(content.fields.id, " is not a DepositLendingEvent object"));
988
1020
  }
989
- return DeactivatingShares.fromFieldsWithTypes(typeArg, content);
1021
+ return DepositLendingEvent.fromFieldsWithTypes(content);
990
1022
  };
991
- DeactivatingShares.fromSuiObjectData = function (typeArg, data) {
1023
+ DepositLendingEvent.fromSuiObjectData = function (data) {
992
1024
  if (data.bcs) {
993
- if (data.bcs.dataType !== "moveObject" || !isDeactivatingShares(data.bcs.type)) {
994
- throw new Error("object at is not a DeactivatingShares object");
995
- }
996
- var gotTypeArgs = (0, util_1.parseTypeName)(data.bcs.type).typeArgs;
997
- if (gotTypeArgs.length !== 1) {
998
- throw new Error("type argument mismatch: expected 1 type argument but got '".concat(gotTypeArgs.length, "'"));
1025
+ if (data.bcs.dataType !== "moveObject" || !isDepositLendingEvent(data.bcs.type)) {
1026
+ throw new Error("object at is not a DepositLendingEvent object");
999
1027
  }
1000
- var gotTypeArg = (0, util_1.compressSuiType)(gotTypeArgs[0]);
1001
- var expectedTypeArg = (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArg));
1002
- if (gotTypeArg !== (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArg))) {
1003
- throw new Error("type argument mismatch: expected '".concat(expectedTypeArg, "' but got '").concat(gotTypeArg, "'"));
1004
- }
1005
- return DeactivatingShares.fromBcs(typeArg, (0, utils_1.fromB64)(data.bcs.bcsBytes));
1028
+ return DepositLendingEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
1006
1029
  }
1007
1030
  if (data.content) {
1008
- return DeactivatingShares.fromSuiParsedData(typeArg, data.content);
1031
+ return DepositLendingEvent.fromSuiParsedData(data.content);
1009
1032
  }
1010
1033
  throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
1011
1034
  };
1012
- DeactivatingShares.fetch = function (client, typeArg, id) {
1035
+ DepositLendingEvent.fetch = function (client, id) {
1013
1036
  return __awaiter(this, void 0, void 0, function () {
1014
1037
  var res;
1015
1038
  var _a, _b;
@@ -1019,22 +1042,22 @@ var DeactivatingShares = /** @class */ (function () {
1019
1042
  case 1:
1020
1043
  res = _c.sent();
1021
1044
  if (res.error) {
1022
- throw new Error("error fetching DeactivatingShares object at id ".concat(id, ": ").concat(res.error.code));
1045
+ throw new Error("error fetching DepositLendingEvent object at id ".concat(id, ": ").concat(res.error.code));
1023
1046
  }
1024
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isDeactivatingShares(res.data.bcs.type)) {
1025
- throw new Error("object at id ".concat(id, " is not a DeactivatingShares object"));
1047
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isDepositLendingEvent(res.data.bcs.type)) {
1048
+ throw new Error("object at id ".concat(id, " is not a DepositLendingEvent object"));
1026
1049
  }
1027
- return [2 /*return*/, DeactivatingShares.fromSuiObjectData(typeArg, res.data)];
1050
+ return [2 /*return*/, DepositLendingEvent.fromSuiObjectData(res.data)];
1028
1051
  }
1029
1052
  });
1030
1053
  });
1031
1054
  };
1032
- DeactivatingShares.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::DeactivatingShares");
1033
- DeactivatingShares.$numTypeParams = 1;
1034
- DeactivatingShares.$isPhantom = [true];
1035
- return DeactivatingShares;
1055
+ DepositLendingEvent.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::DepositLendingEvent");
1056
+ DepositLendingEvent.$numTypeParams = 0;
1057
+ DepositLendingEvent.$isPhantom = [];
1058
+ return DepositLendingEvent;
1036
1059
  }());
1037
- exports.DeactivatingShares = DeactivatingShares;
1060
+ exports.DepositLendingEvent = DepositLendingEvent;
1038
1061
  /* ============================== LiquidityPool =============================== */
1039
1062
  function isLiquidityPool(type) {
1040
1063
  type = (0, util_1.compressSuiType)(type);
@@ -1102,13 +1125,13 @@ var LiquidityPool = /** @class */ (function () {
1102
1125
  Object.defineProperty(LiquidityPool, "bcs", {
1103
1126
  get: function () {
1104
1127
  return bcs_1.bcs.struct("LiquidityPool", {
1105
- id: structs_3.UID.bcs,
1128
+ id: structs_2.UID.bcs,
1106
1129
  index: bcs_1.bcs.u64(),
1107
1130
  lp_token_type: structs_1.TypeName.bcs,
1108
1131
  liquidity_tokens: bcs_1.bcs.vector(structs_1.TypeName.bcs),
1109
1132
  token_pools: bcs_1.bcs.vector(TokenPool.bcs),
1110
1133
  pool_info: LiquidityPoolInfo.bcs,
1111
- liquidated_unsettled_receipts: bcs_1.bcs.vector(structs_4.UnsettledBidReceipt.bcs),
1134
+ liquidated_unsettled_receipts: bcs_1.bcs.vector(structs_3.UnsettledBidReceipt.bcs),
1112
1135
  u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
1113
1136
  bcs_padding: bcs_1.bcs.vector(bcs_1.bcs.u8()),
1114
1137
  });
@@ -1118,13 +1141,13 @@ var LiquidityPool = /** @class */ (function () {
1118
1141
  });
1119
1142
  LiquidityPool.fromFields = function (fields) {
1120
1143
  return LiquidityPool.reified().new({
1121
- id: (0, reified_1.decodeFromFields)(structs_3.UID.reified(), fields.id),
1144
+ id: (0, reified_1.decodeFromFields)(structs_2.UID.reified(), fields.id),
1122
1145
  index: (0, reified_1.decodeFromFields)("u64", fields.index),
1123
1146
  lpTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.lp_token_type),
1124
1147
  liquidityTokens: (0, reified_1.decodeFromFields)(reified.vector(structs_1.TypeName.reified()), fields.liquidity_tokens),
1125
1148
  tokenPools: (0, reified_1.decodeFromFields)(reified.vector(TokenPool.reified()), fields.token_pools),
1126
1149
  poolInfo: (0, reified_1.decodeFromFields)(LiquidityPoolInfo.reified(), fields.pool_info),
1127
- liquidatedUnsettledReceipts: (0, reified_1.decodeFromFields)(reified.vector(structs_4.UnsettledBidReceipt.reified()), fields.liquidated_unsettled_receipts),
1150
+ liquidatedUnsettledReceipts: (0, reified_1.decodeFromFields)(reified.vector(structs_3.UnsettledBidReceipt.reified()), fields.liquidated_unsettled_receipts),
1128
1151
  u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
1129
1152
  bcsPadding: (0, reified_1.decodeFromFields)(reified.vector("u8"), fields.bcs_padding),
1130
1153
  });
@@ -1134,13 +1157,13 @@ var LiquidityPool = /** @class */ (function () {
1134
1157
  throw new Error("not a LiquidityPool type");
1135
1158
  }
1136
1159
  return LiquidityPool.reified().new({
1137
- id: (0, reified_1.decodeFromFieldsWithTypes)(structs_3.UID.reified(), item.fields.id),
1160
+ id: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.UID.reified(), item.fields.id),
1138
1161
  index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
1139
1162
  lpTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.lp_token_type),
1140
1163
  liquidityTokens: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(structs_1.TypeName.reified()), item.fields.liquidity_tokens),
1141
1164
  tokenPools: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(TokenPool.reified()), item.fields.token_pools),
1142
1165
  poolInfo: (0, reified_1.decodeFromFieldsWithTypes)(LiquidityPoolInfo.reified(), item.fields.pool_info),
1143
- liquidatedUnsettledReceipts: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(structs_4.UnsettledBidReceipt.reified()), item.fields.liquidated_unsettled_receipts),
1166
+ liquidatedUnsettledReceipts: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(structs_3.UnsettledBidReceipt.reified()), item.fields.liquidated_unsettled_receipts),
1144
1167
  u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
1145
1168
  bcsPadding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u8"), item.fields.bcs_padding),
1146
1169
  });
@@ -1156,7 +1179,7 @@ var LiquidityPool = /** @class */ (function () {
1156
1179
  liquidityTokens: (0, reified_1.fieldToJSON)("vector<".concat(structs_1.TypeName.$typeName, ">"), this.liquidityTokens),
1157
1180
  tokenPools: (0, reified_1.fieldToJSON)("vector<".concat(TokenPool.$typeName, ">"), this.tokenPools),
1158
1181
  poolInfo: this.poolInfo.toJSONField(),
1159
- liquidatedUnsettledReceipts: (0, reified_1.fieldToJSON)("vector<".concat(structs_4.UnsettledBidReceipt.$typeName, ">"), this.liquidatedUnsettledReceipts),
1182
+ liquidatedUnsettledReceipts: (0, reified_1.fieldToJSON)("vector<".concat(structs_3.UnsettledBidReceipt.$typeName, ">"), this.liquidatedUnsettledReceipts),
1160
1183
  u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
1161
1184
  bcsPadding: (0, reified_1.fieldToJSON)("vector<u8>", this.bcsPadding),
1162
1185
  };
@@ -1166,13 +1189,13 @@ var LiquidityPool = /** @class */ (function () {
1166
1189
  };
1167
1190
  LiquidityPool.fromJSONField = function (field) {
1168
1191
  return LiquidityPool.reified().new({
1169
- id: (0, reified_1.decodeFromJSONField)(structs_3.UID.reified(), field.id),
1192
+ id: (0, reified_1.decodeFromJSONField)(structs_2.UID.reified(), field.id),
1170
1193
  index: (0, reified_1.decodeFromJSONField)("u64", field.index),
1171
1194
  lpTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.lpTokenType),
1172
1195
  liquidityTokens: (0, reified_1.decodeFromJSONField)(reified.vector(structs_1.TypeName.reified()), field.liquidityTokens),
1173
1196
  tokenPools: (0, reified_1.decodeFromJSONField)(reified.vector(TokenPool.reified()), field.tokenPools),
1174
1197
  poolInfo: (0, reified_1.decodeFromJSONField)(LiquidityPoolInfo.reified(), field.poolInfo),
1175
- liquidatedUnsettledReceipts: (0, reified_1.decodeFromJSONField)(reified.vector(structs_4.UnsettledBidReceipt.reified()), field.liquidatedUnsettledReceipts),
1198
+ liquidatedUnsettledReceipts: (0, reified_1.decodeFromJSONField)(reified.vector(structs_3.UnsettledBidReceipt.reified()), field.liquidatedUnsettledReceipts),
1176
1199
  u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
1177
1200
  bcsPadding: (0, reified_1.decodeFromJSONField)(reified.vector("u8"), field.bcsPadding),
1178
1201
  });
@@ -2316,189 +2339,6 @@ var NewLiquidityPoolEvent = /** @class */ (function () {
2316
2339
  return NewLiquidityPoolEvent;
2317
2340
  }());
2318
2341
  exports.NewLiquidityPoolEvent = NewLiquidityPoolEvent;
2319
- /* ============================== RedeemEvent =============================== */
2320
- function isRedeemEvent(type) {
2321
- type = (0, util_1.compressSuiType)(type);
2322
- return type === "".concat(index_1.PKG_V1, "::lp_pool::RedeemEvent");
2323
- }
2324
- var RedeemEvent = /** @class */ (function () {
2325
- function RedeemEvent(typeArgs, fields) {
2326
- this.__StructClass = true;
2327
- this.$typeName = RedeemEvent.$typeName;
2328
- this.$isPhantom = RedeemEvent.$isPhantom;
2329
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([RedeemEvent.$typeName], __read(typeArgs), false));
2330
- this.$typeArgs = typeArgs;
2331
- this.sender = fields.sender;
2332
- this.index = fields.index;
2333
- this.share = fields.share;
2334
- this.sharePrice = fields.sharePrice;
2335
- this.timestampTsMs = fields.timestampTsMs;
2336
- this.unlockTsMs = fields.unlockTsMs;
2337
- this.u64Padding = fields.u64Padding;
2338
- }
2339
- RedeemEvent.reified = function () {
2340
- var _this = this;
2341
- return {
2342
- typeName: RedeemEvent.$typeName,
2343
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([RedeemEvent.$typeName], [], false)),
2344
- typeArgs: [],
2345
- isPhantom: RedeemEvent.$isPhantom,
2346
- reifiedTypeArgs: [],
2347
- fromFields: function (fields) { return RedeemEvent.fromFields(fields); },
2348
- fromFieldsWithTypes: function (item) { return RedeemEvent.fromFieldsWithTypes(item); },
2349
- fromBcs: function (data) { return RedeemEvent.fromBcs(data); },
2350
- bcs: RedeemEvent.bcs,
2351
- fromJSONField: function (field) { return RedeemEvent.fromJSONField(field); },
2352
- fromJSON: function (json) { return RedeemEvent.fromJSON(json); },
2353
- fromSuiParsedData: function (content) { return RedeemEvent.fromSuiParsedData(content); },
2354
- fromSuiObjectData: function (content) { return RedeemEvent.fromSuiObjectData(content); },
2355
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
2356
- return [2 /*return*/, RedeemEvent.fetch(client, id)];
2357
- }); }); },
2358
- new: function (fields) {
2359
- return new RedeemEvent([], fields);
2360
- },
2361
- kind: "StructClassReified",
2362
- };
2363
- };
2364
- Object.defineProperty(RedeemEvent, "r", {
2365
- get: function () {
2366
- return RedeemEvent.reified();
2367
- },
2368
- enumerable: false,
2369
- configurable: true
2370
- });
2371
- RedeemEvent.phantom = function () {
2372
- return (0, reified_1.phantom)(RedeemEvent.reified());
2373
- };
2374
- Object.defineProperty(RedeemEvent, "p", {
2375
- get: function () {
2376
- return RedeemEvent.phantom();
2377
- },
2378
- enumerable: false,
2379
- configurable: true
2380
- });
2381
- Object.defineProperty(RedeemEvent, "bcs", {
2382
- get: function () {
2383
- return bcs_1.bcs.struct("RedeemEvent", {
2384
- sender: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
2385
- index: bcs_1.bcs.u64(),
2386
- share: bcs_1.bcs.u64(),
2387
- share_price: bcs_1.bcs.u64(),
2388
- timestamp_ts_ms: bcs_1.bcs.u64(),
2389
- unlock_ts_ms: bcs_1.bcs.u64(),
2390
- u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
2391
- });
2392
- },
2393
- enumerable: false,
2394
- configurable: true
2395
- });
2396
- RedeemEvent.fromFields = function (fields) {
2397
- return RedeemEvent.reified().new({
2398
- sender: (0, reified_1.decodeFromFields)("address", fields.sender),
2399
- index: (0, reified_1.decodeFromFields)("u64", fields.index),
2400
- share: (0, reified_1.decodeFromFields)("u64", fields.share),
2401
- sharePrice: (0, reified_1.decodeFromFields)("u64", fields.share_price),
2402
- timestampTsMs: (0, reified_1.decodeFromFields)("u64", fields.timestamp_ts_ms),
2403
- unlockTsMs: (0, reified_1.decodeFromFields)("u64", fields.unlock_ts_ms),
2404
- u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
2405
- });
2406
- };
2407
- RedeemEvent.fromFieldsWithTypes = function (item) {
2408
- if (!isRedeemEvent(item.type)) {
2409
- throw new Error("not a RedeemEvent type");
2410
- }
2411
- return RedeemEvent.reified().new({
2412
- sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
2413
- index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
2414
- share: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.share),
2415
- sharePrice: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.share_price),
2416
- timestampTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.timestamp_ts_ms),
2417
- unlockTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.unlock_ts_ms),
2418
- u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
2419
- });
2420
- };
2421
- RedeemEvent.fromBcs = function (data) {
2422
- return RedeemEvent.fromFields(RedeemEvent.bcs.parse(data));
2423
- };
2424
- RedeemEvent.prototype.toJSONField = function () {
2425
- return {
2426
- sender: this.sender,
2427
- index: this.index.toString(),
2428
- share: this.share.toString(),
2429
- sharePrice: this.sharePrice.toString(),
2430
- timestampTsMs: this.timestampTsMs.toString(),
2431
- unlockTsMs: this.unlockTsMs.toString(),
2432
- u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
2433
- };
2434
- };
2435
- RedeemEvent.prototype.toJSON = function () {
2436
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
2437
- };
2438
- RedeemEvent.fromJSONField = function (field) {
2439
- return RedeemEvent.reified().new({
2440
- sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
2441
- index: (0, reified_1.decodeFromJSONField)("u64", field.index),
2442
- share: (0, reified_1.decodeFromJSONField)("u64", field.share),
2443
- sharePrice: (0, reified_1.decodeFromJSONField)("u64", field.sharePrice),
2444
- timestampTsMs: (0, reified_1.decodeFromJSONField)("u64", field.timestampTsMs),
2445
- unlockTsMs: (0, reified_1.decodeFromJSONField)("u64", field.unlockTsMs),
2446
- u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
2447
- });
2448
- };
2449
- RedeemEvent.fromJSON = function (json) {
2450
- if (json.$typeName !== RedeemEvent.$typeName) {
2451
- throw new Error("not a WithTwoGenerics json object");
2452
- }
2453
- return RedeemEvent.fromJSONField(json);
2454
- };
2455
- RedeemEvent.fromSuiParsedData = function (content) {
2456
- if (content.dataType !== "moveObject") {
2457
- throw new Error("not an object");
2458
- }
2459
- if (!isRedeemEvent(content.type)) {
2460
- throw new Error("object at ".concat(content.fields.id, " is not a RedeemEvent object"));
2461
- }
2462
- return RedeemEvent.fromFieldsWithTypes(content);
2463
- };
2464
- RedeemEvent.fromSuiObjectData = function (data) {
2465
- if (data.bcs) {
2466
- if (data.bcs.dataType !== "moveObject" || !isRedeemEvent(data.bcs.type)) {
2467
- throw new Error("object at is not a RedeemEvent object");
2468
- }
2469
- return RedeemEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
2470
- }
2471
- if (data.content) {
2472
- return RedeemEvent.fromSuiParsedData(data.content);
2473
- }
2474
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
2475
- };
2476
- RedeemEvent.fetch = function (client, id) {
2477
- return __awaiter(this, void 0, void 0, function () {
2478
- var res;
2479
- var _a, _b;
2480
- return __generator(this, function (_c) {
2481
- switch (_c.label) {
2482
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
2483
- case 1:
2484
- res = _c.sent();
2485
- if (res.error) {
2486
- throw new Error("error fetching RedeemEvent object at id ".concat(id, ": ").concat(res.error.code));
2487
- }
2488
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isRedeemEvent(res.data.bcs.type)) {
2489
- throw new Error("object at id ".concat(id, " is not a RedeemEvent object"));
2490
- }
2491
- return [2 /*return*/, RedeemEvent.fromSuiObjectData(res.data)];
2492
- }
2493
- });
2494
- });
2495
- };
2496
- RedeemEvent.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::RedeemEvent");
2497
- RedeemEvent.$numTypeParams = 0;
2498
- RedeemEvent.$isPhantom = [];
2499
- return RedeemEvent;
2500
- }());
2501
- exports.RedeemEvent = RedeemEvent;
2502
2342
  /* ============================== Registry =============================== */
2503
2343
  function isRegistry(type) {
2504
2344
  type = (0, util_1.compressSuiType)(type);
@@ -2560,9 +2400,9 @@ var Registry = /** @class */ (function () {
2560
2400
  Object.defineProperty(Registry, "bcs", {
2561
2401
  get: function () {
2562
2402
  return bcs_1.bcs.struct("Registry", {
2563
- id: structs_3.UID.bcs,
2403
+ id: structs_2.UID.bcs,
2564
2404
  num_pool: bcs_1.bcs.u64(),
2565
- liquidity_pool_registry: structs_3.UID.bcs,
2405
+ liquidity_pool_registry: structs_2.UID.bcs,
2566
2406
  });
2567
2407
  },
2568
2408
  enumerable: false,
@@ -2570,9 +2410,9 @@ var Registry = /** @class */ (function () {
2570
2410
  });
2571
2411
  Registry.fromFields = function (fields) {
2572
2412
  return Registry.reified().new({
2573
- id: (0, reified_1.decodeFromFields)(structs_3.UID.reified(), fields.id),
2413
+ id: (0, reified_1.decodeFromFields)(structs_2.UID.reified(), fields.id),
2574
2414
  numPool: (0, reified_1.decodeFromFields)("u64", fields.num_pool),
2575
- liquidityPoolRegistry: (0, reified_1.decodeFromFields)(structs_3.UID.reified(), fields.liquidity_pool_registry),
2415
+ liquidityPoolRegistry: (0, reified_1.decodeFromFields)(structs_2.UID.reified(), fields.liquidity_pool_registry),
2576
2416
  });
2577
2417
  };
2578
2418
  Registry.fromFieldsWithTypes = function (item) {
@@ -2580,9 +2420,9 @@ var Registry = /** @class */ (function () {
2580
2420
  throw new Error("not a Registry type");
2581
2421
  }
2582
2422
  return Registry.reified().new({
2583
- id: (0, reified_1.decodeFromFieldsWithTypes)(structs_3.UID.reified(), item.fields.id),
2423
+ id: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.UID.reified(), item.fields.id),
2584
2424
  numPool: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.num_pool),
2585
- liquidityPoolRegistry: (0, reified_1.decodeFromFieldsWithTypes)(structs_3.UID.reified(), item.fields.liquidity_pool_registry),
2425
+ liquidityPoolRegistry: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.UID.reified(), item.fields.liquidity_pool_registry),
2586
2426
  });
2587
2427
  };
2588
2428
  Registry.fromBcs = function (data) {
@@ -2600,9 +2440,9 @@ var Registry = /** @class */ (function () {
2600
2440
  };
2601
2441
  Registry.fromJSONField = function (field) {
2602
2442
  return Registry.reified().new({
2603
- id: (0, reified_1.decodeFromJSONField)(structs_3.UID.reified(), field.id),
2443
+ id: (0, reified_1.decodeFromJSONField)(structs_2.UID.reified(), field.id),
2604
2444
  numPool: (0, reified_1.decodeFromJSONField)("u64", field.numPool),
2605
- liquidityPoolRegistry: (0, reified_1.decodeFromJSONField)(structs_3.UID.reified(), field.liquidityPoolRegistry),
2445
+ liquidityPoolRegistry: (0, reified_1.decodeFromJSONField)(structs_2.UID.reified(), field.liquidityPoolRegistry),
2606
2446
  });
2607
2447
  };
2608
2448
  Registry.fromJSON = function (json) {
@@ -5162,152 +5002,212 @@ var UpdateSpotConfigEvent = /** @class */ (function () {
5162
5002
  return UpdateSpotConfigEvent;
5163
5003
  }());
5164
5004
  exports.UpdateSpotConfigEvent = UpdateSpotConfigEvent;
5165
- /* ============================== UpdateUnlockCountdownTsMsEvent =============================== */
5166
- function isUpdateUnlockCountdownTsMsEvent(type) {
5005
+ /* ============================== WithdrawLendingEvent =============================== */
5006
+ function isWithdrawLendingEvent(type) {
5167
5007
  type = (0, util_1.compressSuiType)(type);
5168
- return type === "".concat(index_1.PKG_V1, "::lp_pool::UpdateUnlockCountdownTsMsEvent");
5008
+ return type === "".concat(index_1.PKG_V1, "::lp_pool::WithdrawLendingEvent");
5169
5009
  }
5170
- var UpdateUnlockCountdownTsMsEvent = /** @class */ (function () {
5171
- function UpdateUnlockCountdownTsMsEvent(typeArgs, fields) {
5010
+ var WithdrawLendingEvent = /** @class */ (function () {
5011
+ function WithdrawLendingEvent(typeArgs, fields) {
5172
5012
  this.__StructClass = true;
5173
- this.$typeName = UpdateUnlockCountdownTsMsEvent.$typeName;
5174
- this.$isPhantom = UpdateUnlockCountdownTsMsEvent.$isPhantom;
5175
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([UpdateUnlockCountdownTsMsEvent.$typeName], __read(typeArgs), false));
5013
+ this.$typeName = WithdrawLendingEvent.$typeName;
5014
+ this.$isPhantom = WithdrawLendingEvent.$isPhantom;
5015
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([WithdrawLendingEvent.$typeName], __read(typeArgs), false));
5176
5016
  this.$typeArgs = typeArgs;
5177
- this.sender = fields.sender;
5178
5017
  this.index = fields.index;
5179
- this.previousUnlockCountdownTsMs = fields.previousUnlockCountdownTsMs;
5180
- this.newUnlockCountdownTsMs = fields.newUnlockCountdownTsMs;
5018
+ this.lendingIndex = fields.lendingIndex;
5019
+ this.cTokenType = fields.cTokenType;
5020
+ this.rTokenType = fields.rTokenType;
5021
+ this.withdrawAmount = fields.withdrawAmount;
5022
+ this.withdrawnCollateralAmount = fields.withdrawnCollateralAmount;
5023
+ this.latestLendingAmount = fields.latestLendingAmount;
5024
+ this.latestMarketCoinAmount = fields.latestMarketCoinAmount;
5025
+ this.latestReservedAmount = fields.latestReservedAmount;
5026
+ this.latestLiquidityAmount = fields.latestLiquidityAmount;
5027
+ this.lendingInterest = fields.lendingInterest;
5028
+ this.protocolShare = fields.protocolShare;
5029
+ this.lendingReward = fields.lendingReward;
5030
+ this.rewardProtocolShare = fields.rewardProtocolShare;
5181
5031
  this.u64Padding = fields.u64Padding;
5182
5032
  }
5183
- UpdateUnlockCountdownTsMsEvent.reified = function () {
5033
+ WithdrawLendingEvent.reified = function () {
5184
5034
  var _this = this;
5185
5035
  return {
5186
- typeName: UpdateUnlockCountdownTsMsEvent.$typeName,
5187
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([UpdateUnlockCountdownTsMsEvent.$typeName], [], false)),
5036
+ typeName: WithdrawLendingEvent.$typeName,
5037
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([WithdrawLendingEvent.$typeName], [], false)),
5188
5038
  typeArgs: [],
5189
- isPhantom: UpdateUnlockCountdownTsMsEvent.$isPhantom,
5039
+ isPhantom: WithdrawLendingEvent.$isPhantom,
5190
5040
  reifiedTypeArgs: [],
5191
- fromFields: function (fields) { return UpdateUnlockCountdownTsMsEvent.fromFields(fields); },
5192
- fromFieldsWithTypes: function (item) { return UpdateUnlockCountdownTsMsEvent.fromFieldsWithTypes(item); },
5193
- fromBcs: function (data) { return UpdateUnlockCountdownTsMsEvent.fromBcs(data); },
5194
- bcs: UpdateUnlockCountdownTsMsEvent.bcs,
5195
- fromJSONField: function (field) { return UpdateUnlockCountdownTsMsEvent.fromJSONField(field); },
5196
- fromJSON: function (json) { return UpdateUnlockCountdownTsMsEvent.fromJSON(json); },
5197
- fromSuiParsedData: function (content) { return UpdateUnlockCountdownTsMsEvent.fromSuiParsedData(content); },
5198
- fromSuiObjectData: function (content) { return UpdateUnlockCountdownTsMsEvent.fromSuiObjectData(content); },
5041
+ fromFields: function (fields) { return WithdrawLendingEvent.fromFields(fields); },
5042
+ fromFieldsWithTypes: function (item) { return WithdrawLendingEvent.fromFieldsWithTypes(item); },
5043
+ fromBcs: function (data) { return WithdrawLendingEvent.fromBcs(data); },
5044
+ bcs: WithdrawLendingEvent.bcs,
5045
+ fromJSONField: function (field) { return WithdrawLendingEvent.fromJSONField(field); },
5046
+ fromJSON: function (json) { return WithdrawLendingEvent.fromJSON(json); },
5047
+ fromSuiParsedData: function (content) { return WithdrawLendingEvent.fromSuiParsedData(content); },
5048
+ fromSuiObjectData: function (content) { return WithdrawLendingEvent.fromSuiObjectData(content); },
5199
5049
  fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
5200
- return [2 /*return*/, UpdateUnlockCountdownTsMsEvent.fetch(client, id)];
5050
+ return [2 /*return*/, WithdrawLendingEvent.fetch(client, id)];
5201
5051
  }); }); },
5202
5052
  new: function (fields) {
5203
- return new UpdateUnlockCountdownTsMsEvent([], fields);
5053
+ return new WithdrawLendingEvent([], fields);
5204
5054
  },
5205
5055
  kind: "StructClassReified",
5206
5056
  };
5207
5057
  };
5208
- Object.defineProperty(UpdateUnlockCountdownTsMsEvent, "r", {
5058
+ Object.defineProperty(WithdrawLendingEvent, "r", {
5209
5059
  get: function () {
5210
- return UpdateUnlockCountdownTsMsEvent.reified();
5060
+ return WithdrawLendingEvent.reified();
5211
5061
  },
5212
5062
  enumerable: false,
5213
5063
  configurable: true
5214
5064
  });
5215
- UpdateUnlockCountdownTsMsEvent.phantom = function () {
5216
- return (0, reified_1.phantom)(UpdateUnlockCountdownTsMsEvent.reified());
5065
+ WithdrawLendingEvent.phantom = function () {
5066
+ return (0, reified_1.phantom)(WithdrawLendingEvent.reified());
5217
5067
  };
5218
- Object.defineProperty(UpdateUnlockCountdownTsMsEvent, "p", {
5068
+ Object.defineProperty(WithdrawLendingEvent, "p", {
5219
5069
  get: function () {
5220
- return UpdateUnlockCountdownTsMsEvent.phantom();
5070
+ return WithdrawLendingEvent.phantom();
5221
5071
  },
5222
5072
  enumerable: false,
5223
5073
  configurable: true
5224
5074
  });
5225
- Object.defineProperty(UpdateUnlockCountdownTsMsEvent, "bcs", {
5075
+ Object.defineProperty(WithdrawLendingEvent, "bcs", {
5226
5076
  get: function () {
5227
- return bcs_1.bcs.struct("UpdateUnlockCountdownTsMsEvent", {
5228
- sender: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
5077
+ return bcs_1.bcs.struct("WithdrawLendingEvent", {
5229
5078
  index: bcs_1.bcs.u64(),
5230
- previous_unlock_countdown_ts_ms: bcs_1.bcs.u64(),
5231
- new_unlock_countdown_ts_ms: bcs_1.bcs.u64(),
5079
+ lending_index: bcs_1.bcs.u64(),
5080
+ c_token_type: structs_1.TypeName.bcs,
5081
+ r_token_type: structs_1.TypeName.bcs,
5082
+ withdraw_amount: bcs_1.bcs.u64(),
5083
+ withdrawn_collateral_amount: bcs_1.bcs.u64(),
5084
+ latest_lending_amount: bcs_1.bcs.u64(),
5085
+ latest_market_coin_amount: bcs_1.bcs.u64(),
5086
+ latest_reserved_amount: bcs_1.bcs.u64(),
5087
+ latest_liquidity_amount: bcs_1.bcs.u64(),
5088
+ lending_interest: bcs_1.bcs.u64(),
5089
+ protocol_share: bcs_1.bcs.u64(),
5090
+ lending_reward: bcs_1.bcs.u64(),
5091
+ reward_protocol_share: bcs_1.bcs.u64(),
5232
5092
  u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
5233
5093
  });
5234
5094
  },
5235
5095
  enumerable: false,
5236
5096
  configurable: true
5237
5097
  });
5238
- UpdateUnlockCountdownTsMsEvent.fromFields = function (fields) {
5239
- return UpdateUnlockCountdownTsMsEvent.reified().new({
5240
- sender: (0, reified_1.decodeFromFields)("address", fields.sender),
5098
+ WithdrawLendingEvent.fromFields = function (fields) {
5099
+ return WithdrawLendingEvent.reified().new({
5241
5100
  index: (0, reified_1.decodeFromFields)("u64", fields.index),
5242
- previousUnlockCountdownTsMs: (0, reified_1.decodeFromFields)("u64", fields.previous_unlock_countdown_ts_ms),
5243
- newUnlockCountdownTsMs: (0, reified_1.decodeFromFields)("u64", fields.new_unlock_countdown_ts_ms),
5101
+ lendingIndex: (0, reified_1.decodeFromFields)("u64", fields.lending_index),
5102
+ cTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.c_token_type),
5103
+ rTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.r_token_type),
5104
+ withdrawAmount: (0, reified_1.decodeFromFields)("u64", fields.withdraw_amount),
5105
+ withdrawnCollateralAmount: (0, reified_1.decodeFromFields)("u64", fields.withdrawn_collateral_amount),
5106
+ latestLendingAmount: (0, reified_1.decodeFromFields)("u64", fields.latest_lending_amount),
5107
+ latestMarketCoinAmount: (0, reified_1.decodeFromFields)("u64", fields.latest_market_coin_amount),
5108
+ latestReservedAmount: (0, reified_1.decodeFromFields)("u64", fields.latest_reserved_amount),
5109
+ latestLiquidityAmount: (0, reified_1.decodeFromFields)("u64", fields.latest_liquidity_amount),
5110
+ lendingInterest: (0, reified_1.decodeFromFields)("u64", fields.lending_interest),
5111
+ protocolShare: (0, reified_1.decodeFromFields)("u64", fields.protocol_share),
5112
+ lendingReward: (0, reified_1.decodeFromFields)("u64", fields.lending_reward),
5113
+ rewardProtocolShare: (0, reified_1.decodeFromFields)("u64", fields.reward_protocol_share),
5244
5114
  u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
5245
5115
  });
5246
5116
  };
5247
- UpdateUnlockCountdownTsMsEvent.fromFieldsWithTypes = function (item) {
5248
- if (!isUpdateUnlockCountdownTsMsEvent(item.type)) {
5249
- throw new Error("not a UpdateUnlockCountdownTsMsEvent type");
5117
+ WithdrawLendingEvent.fromFieldsWithTypes = function (item) {
5118
+ if (!isWithdrawLendingEvent(item.type)) {
5119
+ throw new Error("not a WithdrawLendingEvent type");
5250
5120
  }
5251
- return UpdateUnlockCountdownTsMsEvent.reified().new({
5252
- sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
5121
+ return WithdrawLendingEvent.reified().new({
5253
5122
  index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
5254
- previousUnlockCountdownTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.previous_unlock_countdown_ts_ms),
5255
- newUnlockCountdownTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.new_unlock_countdown_ts_ms),
5123
+ lendingIndex: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.lending_index),
5124
+ cTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.c_token_type),
5125
+ rTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.r_token_type),
5126
+ withdrawAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.withdraw_amount),
5127
+ withdrawnCollateralAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.withdrawn_collateral_amount),
5128
+ latestLendingAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.latest_lending_amount),
5129
+ latestMarketCoinAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.latest_market_coin_amount),
5130
+ latestReservedAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.latest_reserved_amount),
5131
+ latestLiquidityAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.latest_liquidity_amount),
5132
+ lendingInterest: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.lending_interest),
5133
+ protocolShare: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.protocol_share),
5134
+ lendingReward: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.lending_reward),
5135
+ rewardProtocolShare: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.reward_protocol_share),
5256
5136
  u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
5257
5137
  });
5258
5138
  };
5259
- UpdateUnlockCountdownTsMsEvent.fromBcs = function (data) {
5260
- return UpdateUnlockCountdownTsMsEvent.fromFields(UpdateUnlockCountdownTsMsEvent.bcs.parse(data));
5139
+ WithdrawLendingEvent.fromBcs = function (data) {
5140
+ return WithdrawLendingEvent.fromFields(WithdrawLendingEvent.bcs.parse(data));
5261
5141
  };
5262
- UpdateUnlockCountdownTsMsEvent.prototype.toJSONField = function () {
5142
+ WithdrawLendingEvent.prototype.toJSONField = function () {
5263
5143
  return {
5264
- sender: this.sender,
5265
5144
  index: this.index.toString(),
5266
- previousUnlockCountdownTsMs: this.previousUnlockCountdownTsMs.toString(),
5267
- newUnlockCountdownTsMs: this.newUnlockCountdownTsMs.toString(),
5145
+ lendingIndex: this.lendingIndex.toString(),
5146
+ cTokenType: this.cTokenType.toJSONField(),
5147
+ rTokenType: this.rTokenType.toJSONField(),
5148
+ withdrawAmount: this.withdrawAmount.toString(),
5149
+ withdrawnCollateralAmount: this.withdrawnCollateralAmount.toString(),
5150
+ latestLendingAmount: this.latestLendingAmount.toString(),
5151
+ latestMarketCoinAmount: this.latestMarketCoinAmount.toString(),
5152
+ latestReservedAmount: this.latestReservedAmount.toString(),
5153
+ latestLiquidityAmount: this.latestLiquidityAmount.toString(),
5154
+ lendingInterest: this.lendingInterest.toString(),
5155
+ protocolShare: this.protocolShare.toString(),
5156
+ lendingReward: this.lendingReward.toString(),
5157
+ rewardProtocolShare: this.rewardProtocolShare.toString(),
5268
5158
  u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
5269
5159
  };
5270
5160
  };
5271
- UpdateUnlockCountdownTsMsEvent.prototype.toJSON = function () {
5161
+ WithdrawLendingEvent.prototype.toJSON = function () {
5272
5162
  return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
5273
5163
  };
5274
- UpdateUnlockCountdownTsMsEvent.fromJSONField = function (field) {
5275
- return UpdateUnlockCountdownTsMsEvent.reified().new({
5276
- sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
5164
+ WithdrawLendingEvent.fromJSONField = function (field) {
5165
+ return WithdrawLendingEvent.reified().new({
5277
5166
  index: (0, reified_1.decodeFromJSONField)("u64", field.index),
5278
- previousUnlockCountdownTsMs: (0, reified_1.decodeFromJSONField)("u64", field.previousUnlockCountdownTsMs),
5279
- newUnlockCountdownTsMs: (0, reified_1.decodeFromJSONField)("u64", field.newUnlockCountdownTsMs),
5167
+ lendingIndex: (0, reified_1.decodeFromJSONField)("u64", field.lendingIndex),
5168
+ cTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.cTokenType),
5169
+ rTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.rTokenType),
5170
+ withdrawAmount: (0, reified_1.decodeFromJSONField)("u64", field.withdrawAmount),
5171
+ withdrawnCollateralAmount: (0, reified_1.decodeFromJSONField)("u64", field.withdrawnCollateralAmount),
5172
+ latestLendingAmount: (0, reified_1.decodeFromJSONField)("u64", field.latestLendingAmount),
5173
+ latestMarketCoinAmount: (0, reified_1.decodeFromJSONField)("u64", field.latestMarketCoinAmount),
5174
+ latestReservedAmount: (0, reified_1.decodeFromJSONField)("u64", field.latestReservedAmount),
5175
+ latestLiquidityAmount: (0, reified_1.decodeFromJSONField)("u64", field.latestLiquidityAmount),
5176
+ lendingInterest: (0, reified_1.decodeFromJSONField)("u64", field.lendingInterest),
5177
+ protocolShare: (0, reified_1.decodeFromJSONField)("u64", field.protocolShare),
5178
+ lendingReward: (0, reified_1.decodeFromJSONField)("u64", field.lendingReward),
5179
+ rewardProtocolShare: (0, reified_1.decodeFromJSONField)("u64", field.rewardProtocolShare),
5280
5180
  u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
5281
5181
  });
5282
5182
  };
5283
- UpdateUnlockCountdownTsMsEvent.fromJSON = function (json) {
5284
- if (json.$typeName !== UpdateUnlockCountdownTsMsEvent.$typeName) {
5183
+ WithdrawLendingEvent.fromJSON = function (json) {
5184
+ if (json.$typeName !== WithdrawLendingEvent.$typeName) {
5285
5185
  throw new Error("not a WithTwoGenerics json object");
5286
5186
  }
5287
- return UpdateUnlockCountdownTsMsEvent.fromJSONField(json);
5187
+ return WithdrawLendingEvent.fromJSONField(json);
5288
5188
  };
5289
- UpdateUnlockCountdownTsMsEvent.fromSuiParsedData = function (content) {
5189
+ WithdrawLendingEvent.fromSuiParsedData = function (content) {
5290
5190
  if (content.dataType !== "moveObject") {
5291
5191
  throw new Error("not an object");
5292
5192
  }
5293
- if (!isUpdateUnlockCountdownTsMsEvent(content.type)) {
5294
- throw new Error("object at ".concat(content.fields.id, " is not a UpdateUnlockCountdownTsMsEvent object"));
5193
+ if (!isWithdrawLendingEvent(content.type)) {
5194
+ throw new Error("object at ".concat(content.fields.id, " is not a WithdrawLendingEvent object"));
5295
5195
  }
5296
- return UpdateUnlockCountdownTsMsEvent.fromFieldsWithTypes(content);
5196
+ return WithdrawLendingEvent.fromFieldsWithTypes(content);
5297
5197
  };
5298
- UpdateUnlockCountdownTsMsEvent.fromSuiObjectData = function (data) {
5198
+ WithdrawLendingEvent.fromSuiObjectData = function (data) {
5299
5199
  if (data.bcs) {
5300
- if (data.bcs.dataType !== "moveObject" || !isUpdateUnlockCountdownTsMsEvent(data.bcs.type)) {
5301
- throw new Error("object at is not a UpdateUnlockCountdownTsMsEvent object");
5200
+ if (data.bcs.dataType !== "moveObject" || !isWithdrawLendingEvent(data.bcs.type)) {
5201
+ throw new Error("object at is not a WithdrawLendingEvent object");
5302
5202
  }
5303
- return UpdateUnlockCountdownTsMsEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
5203
+ return WithdrawLendingEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
5304
5204
  }
5305
5205
  if (data.content) {
5306
- return UpdateUnlockCountdownTsMsEvent.fromSuiParsedData(data.content);
5206
+ return WithdrawLendingEvent.fromSuiParsedData(data.content);
5307
5207
  }
5308
5208
  throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
5309
5209
  };
5310
- UpdateUnlockCountdownTsMsEvent.fetch = function (client, id) {
5210
+ WithdrawLendingEvent.fetch = function (client, id) {
5311
5211
  return __awaiter(this, void 0, void 0, function () {
5312
5212
  var res;
5313
5213
  var _a, _b;
@@ -5317,19 +5217,19 @@ var UpdateUnlockCountdownTsMsEvent = /** @class */ (function () {
5317
5217
  case 1:
5318
5218
  res = _c.sent();
5319
5219
  if (res.error) {
5320
- throw new Error("error fetching UpdateUnlockCountdownTsMsEvent object at id ".concat(id, ": ").concat(res.error.code));
5220
+ throw new Error("error fetching WithdrawLendingEvent object at id ".concat(id, ": ").concat(res.error.code));
5321
5221
  }
5322
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isUpdateUnlockCountdownTsMsEvent(res.data.bcs.type)) {
5323
- throw new Error("object at id ".concat(id, " is not a UpdateUnlockCountdownTsMsEvent object"));
5222
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isWithdrawLendingEvent(res.data.bcs.type)) {
5223
+ throw new Error("object at id ".concat(id, " is not a WithdrawLendingEvent object"));
5324
5224
  }
5325
- return [2 /*return*/, UpdateUnlockCountdownTsMsEvent.fromSuiObjectData(res.data)];
5225
+ return [2 /*return*/, WithdrawLendingEvent.fromSuiObjectData(res.data)];
5326
5226
  }
5327
5227
  });
5328
5228
  });
5329
5229
  };
5330
- UpdateUnlockCountdownTsMsEvent.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::UpdateUnlockCountdownTsMsEvent");
5331
- UpdateUnlockCountdownTsMsEvent.$numTypeParams = 0;
5332
- UpdateUnlockCountdownTsMsEvent.$isPhantom = [];
5333
- return UpdateUnlockCountdownTsMsEvent;
5230
+ WithdrawLendingEvent.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::WithdrawLendingEvent");
5231
+ WithdrawLendingEvent.$numTypeParams = 0;
5232
+ WithdrawLendingEvent.$isPhantom = [];
5233
+ return WithdrawLendingEvent;
5334
5234
  }());
5335
- exports.UpdateUnlockCountdownTsMsEvent = UpdateUnlockCountdownTsMsEvent;
5235
+ exports.WithdrawLendingEvent = WithdrawLendingEvent;