@typus/typus-perp-sdk 1.0.67 → 1.0.68
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/src/fetch.d.ts +4 -3
- package/dist/src/fetch.js +30 -34
- package/dist/src/index.js +13 -6
- package/dist/src/typus_perp/error/functions.d.ts +2 -0
- package/dist/src/typus_perp/error/functions.js +10 -0
- package/dist/src/typus_perp/lp-pool/functions.d.ts +60 -27
- package/dist/src/typus_perp/lp-pool/functions.js +92 -52
- package/dist/src/typus_perp/lp-pool/structs.d.ts +161 -210
- package/dist/src/typus_perp/lp-pool/structs.js +384 -284
- package/dist/src/typus_perp/trading/functions.d.ts +6 -0
- package/dist/src/typus_perp/trading/functions.js +9 -0
- package/dist/src/typus_stake_pool/stake-pool/functions.d.ts +9 -0
- package/dist/src/typus_stake_pool/stake-pool/functions.js +20 -0
- package/dist/src/user/tlp.d.ts +23 -9
- package/dist/src/user/tlp.js +148 -61
- package/package.json +2 -2
|
@@ -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.
|
|
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;
|
|
109
109
|
exports.isAddLiquidityTokenEvent = isAddLiquidityTokenEvent;
|
|
110
110
|
exports.isBurnLpEvent = isBurnLpEvent;
|
|
111
111
|
exports.isCompleteRemoveLiquidityTokenProcessEvent = isCompleteRemoveLiquidityTokenProcessEvent;
|
|
112
112
|
exports.isConfig = isConfig;
|
|
113
|
-
exports.
|
|
113
|
+
exports.isDeactivatingShares = isDeactivatingShares;
|
|
114
114
|
exports.isLiquidityPool = isLiquidityPool;
|
|
115
115
|
exports.isLiquidityPoolInfo = isLiquidityPoolInfo;
|
|
116
116
|
exports.isManagerFlashRemoveLiquidityEvent = isManagerFlashRemoveLiquidityEvent;
|
|
@@ -118,6 +118,7 @@ exports.isManagerFlashRepayLiquidityEvent = isManagerFlashRepayLiquidityEvent;
|
|
|
118
118
|
exports.isMarginConfig = isMarginConfig;
|
|
119
119
|
exports.isMintLpEvent = isMintLpEvent;
|
|
120
120
|
exports.isNewLiquidityPoolEvent = isNewLiquidityPoolEvent;
|
|
121
|
+
exports.isRedeemEvent = isRedeemEvent;
|
|
121
122
|
exports.isRegistry = isRegistry;
|
|
122
123
|
exports.isRemoveLiquidityTokenProcess = isRemoveLiquidityTokenProcess;
|
|
123
124
|
exports.isResumePoolEvent = isResumePoolEvent;
|
|
@@ -133,13 +134,14 @@ exports.isUpdateBorrowInfoEvent = isUpdateBorrowInfoEvent;
|
|
|
133
134
|
exports.isUpdateLiquidityValueEvent = isUpdateLiquidityValueEvent;
|
|
134
135
|
exports.isUpdateMarginConfigEvent = isUpdateMarginConfigEvent;
|
|
135
136
|
exports.isUpdateSpotConfigEvent = isUpdateSpotConfigEvent;
|
|
136
|
-
exports.
|
|
137
|
+
exports.isUpdateUnlockCountdownTsMsEvent = isUpdateUnlockCountdownTsMsEvent;
|
|
137
138
|
var reified = __importStar(require("../../_framework/reified"));
|
|
138
139
|
var structs_1 = require("../../_dependencies/source/0x1/type-name/structs");
|
|
139
|
-
var structs_2 = require("../../_dependencies/source/0x2/
|
|
140
|
+
var structs_2 = require("../../_dependencies/source/0x2/balance/structs");
|
|
141
|
+
var structs_3 = require("../../_dependencies/source/0x2/object/structs");
|
|
140
142
|
var reified_1 = require("../../_framework/reified");
|
|
141
143
|
var util_1 = require("../../_framework/util");
|
|
142
|
-
var
|
|
144
|
+
var structs_4 = require("../escrow/structs");
|
|
143
145
|
var index_1 = require("../index");
|
|
144
146
|
var bcs_1 = require("@mysten/sui/bcs");
|
|
145
147
|
var utils_1 = require("@mysten/sui/utils");
|
|
@@ -857,182 +859,157 @@ var Config = /** @class */ (function () {
|
|
|
857
859
|
return Config;
|
|
858
860
|
}());
|
|
859
861
|
exports.Config = Config;
|
|
860
|
-
/* ==============================
|
|
861
|
-
function
|
|
862
|
+
/* ============================== DeactivatingShares =============================== */
|
|
863
|
+
function isDeactivatingShares(type) {
|
|
862
864
|
type = (0, util_1.compressSuiType)(type);
|
|
863
|
-
return type
|
|
865
|
+
return type.startsWith("".concat(index_1.PKG_V1, "::lp_pool::DeactivatingShares") + "<");
|
|
864
866
|
}
|
|
865
|
-
var
|
|
866
|
-
function
|
|
867
|
+
var DeactivatingShares = /** @class */ (function () {
|
|
868
|
+
function DeactivatingShares(typeArgs, fields) {
|
|
867
869
|
this.__StructClass = true;
|
|
868
|
-
this.$typeName =
|
|
869
|
-
this.$isPhantom =
|
|
870
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([
|
|
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));
|
|
871
873
|
this.$typeArgs = typeArgs;
|
|
872
|
-
this.
|
|
873
|
-
this.
|
|
874
|
-
this.
|
|
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;
|
|
874
|
+
this.balance = fields.balance;
|
|
875
|
+
this.redeemTsMs = fields.redeemTsMs;
|
|
876
|
+
this.unlockTsMs = fields.unlockTsMs;
|
|
881
877
|
this.u64Padding = fields.u64Padding;
|
|
882
878
|
}
|
|
883
|
-
|
|
879
|
+
DeactivatingShares.reified = function (TOKEN) {
|
|
884
880
|
var _this = this;
|
|
885
881
|
return {
|
|
886
|
-
typeName:
|
|
887
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([
|
|
888
|
-
typeArgs: [],
|
|
889
|
-
isPhantom:
|
|
890
|
-
reifiedTypeArgs: [],
|
|
891
|
-
fromFields: function (fields) { return
|
|
892
|
-
fromFieldsWithTypes: function (item) { return
|
|
893
|
-
fromBcs: function (data) { return
|
|
894
|
-
bcs:
|
|
895
|
-
fromJSONField: function (field) { return
|
|
896
|
-
fromJSON: function (json) { return
|
|
897
|
-
fromSuiParsedData: function (content) { return
|
|
898
|
-
fromSuiObjectData: function (content) { 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); },
|
|
899
895
|
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
900
|
-
return [2 /*return*/,
|
|
896
|
+
return [2 /*return*/, DeactivatingShares.fetch(client, TOKEN, id)];
|
|
901
897
|
}); }); },
|
|
902
898
|
new: function (fields) {
|
|
903
|
-
return new
|
|
899
|
+
return new DeactivatingShares([(0, reified_1.extractType)(TOKEN)], fields);
|
|
904
900
|
},
|
|
905
901
|
kind: "StructClassReified",
|
|
906
902
|
};
|
|
907
903
|
};
|
|
908
|
-
Object.defineProperty(
|
|
904
|
+
Object.defineProperty(DeactivatingShares, "r", {
|
|
909
905
|
get: function () {
|
|
910
|
-
return
|
|
906
|
+
return DeactivatingShares.reified;
|
|
911
907
|
},
|
|
912
908
|
enumerable: false,
|
|
913
909
|
configurable: true
|
|
914
910
|
});
|
|
915
|
-
|
|
916
|
-
return (0, reified_1.phantom)(
|
|
911
|
+
DeactivatingShares.phantom = function (TOKEN) {
|
|
912
|
+
return (0, reified_1.phantom)(DeactivatingShares.reified(TOKEN));
|
|
917
913
|
};
|
|
918
|
-
Object.defineProperty(
|
|
914
|
+
Object.defineProperty(DeactivatingShares, "p", {
|
|
919
915
|
get: function () {
|
|
920
|
-
return
|
|
916
|
+
return DeactivatingShares.phantom;
|
|
921
917
|
},
|
|
922
918
|
enumerable: false,
|
|
923
919
|
configurable: true
|
|
924
920
|
});
|
|
925
|
-
Object.defineProperty(
|
|
921
|
+
Object.defineProperty(DeactivatingShares, "bcs", {
|
|
926
922
|
get: function () {
|
|
927
|
-
return bcs_1.bcs.struct("
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
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(),
|
|
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(),
|
|
937
927
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
938
928
|
});
|
|
939
929
|
},
|
|
940
930
|
enumerable: false,
|
|
941
931
|
configurable: true
|
|
942
932
|
});
|
|
943
|
-
|
|
944
|
-
return
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
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),
|
|
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),
|
|
954
938
|
u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
|
|
955
939
|
});
|
|
956
940
|
};
|
|
957
|
-
|
|
958
|
-
if (!
|
|
959
|
-
throw new Error("not a
|
|
941
|
+
DeactivatingShares.fromFieldsWithTypes = function (typeArg, item) {
|
|
942
|
+
if (!isDeactivatingShares(item.type)) {
|
|
943
|
+
throw new Error("not a DeactivatingShares type");
|
|
960
944
|
}
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
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),
|
|
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),
|
|
971
950
|
u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
|
|
972
951
|
});
|
|
973
952
|
};
|
|
974
|
-
|
|
975
|
-
return
|
|
953
|
+
DeactivatingShares.fromBcs = function (typeArg, data) {
|
|
954
|
+
return DeactivatingShares.fromFields(typeArg, DeactivatingShares.bcs.parse(data));
|
|
976
955
|
};
|
|
977
|
-
|
|
956
|
+
DeactivatingShares.prototype.toJSONField = function () {
|
|
978
957
|
return {
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
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(),
|
|
958
|
+
balance: this.balance.toJSONField(),
|
|
959
|
+
redeemTsMs: this.redeemTsMs.toString(),
|
|
960
|
+
unlockTsMs: this.unlockTsMs.toString(),
|
|
988
961
|
u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
|
|
989
962
|
};
|
|
990
963
|
};
|
|
991
|
-
|
|
964
|
+
DeactivatingShares.prototype.toJSON = function () {
|
|
992
965
|
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
993
966
|
};
|
|
994
|
-
|
|
995
|
-
return
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
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),
|
|
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),
|
|
1005
972
|
u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
|
|
1006
973
|
});
|
|
1007
974
|
};
|
|
1008
|
-
|
|
1009
|
-
if (json.$typeName !==
|
|
975
|
+
DeactivatingShares.fromJSON = function (typeArg, json) {
|
|
976
|
+
if (json.$typeName !== DeactivatingShares.$typeName) {
|
|
1010
977
|
throw new Error("not a WithTwoGenerics json object");
|
|
1011
978
|
}
|
|
1012
|
-
|
|
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);
|
|
1013
981
|
};
|
|
1014
|
-
|
|
982
|
+
DeactivatingShares.fromSuiParsedData = function (typeArg, content) {
|
|
1015
983
|
if (content.dataType !== "moveObject") {
|
|
1016
984
|
throw new Error("not an object");
|
|
1017
985
|
}
|
|
1018
|
-
if (!
|
|
1019
|
-
throw new Error("object at ".concat(content.fields.id, " is not a
|
|
986
|
+
if (!isDeactivatingShares(content.type)) {
|
|
987
|
+
throw new Error("object at ".concat(content.fields.id, " is not a DeactivatingShares object"));
|
|
1020
988
|
}
|
|
1021
|
-
return
|
|
989
|
+
return DeactivatingShares.fromFieldsWithTypes(typeArg, content);
|
|
1022
990
|
};
|
|
1023
|
-
|
|
991
|
+
DeactivatingShares.fromSuiObjectData = function (typeArg, data) {
|
|
1024
992
|
if (data.bcs) {
|
|
1025
|
-
if (data.bcs.dataType !== "moveObject" || !
|
|
1026
|
-
throw new Error("object at is not a
|
|
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, "'"));
|
|
1027
999
|
}
|
|
1028
|
-
|
|
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));
|
|
1029
1006
|
}
|
|
1030
1007
|
if (data.content) {
|
|
1031
|
-
return
|
|
1008
|
+
return DeactivatingShares.fromSuiParsedData(typeArg, data.content);
|
|
1032
1009
|
}
|
|
1033
1010
|
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
1034
1011
|
};
|
|
1035
|
-
|
|
1012
|
+
DeactivatingShares.fetch = function (client, typeArg, id) {
|
|
1036
1013
|
return __awaiter(this, void 0, void 0, function () {
|
|
1037
1014
|
var res;
|
|
1038
1015
|
var _a, _b;
|
|
@@ -1042,22 +1019,22 @@ var DepositLendingEvent = /** @class */ (function () {
|
|
|
1042
1019
|
case 1:
|
|
1043
1020
|
res = _c.sent();
|
|
1044
1021
|
if (res.error) {
|
|
1045
|
-
throw new Error("error fetching
|
|
1022
|
+
throw new Error("error fetching DeactivatingShares object at id ".concat(id, ": ").concat(res.error.code));
|
|
1046
1023
|
}
|
|
1047
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !
|
|
1048
|
-
throw new Error("object at id ".concat(id, " is not a
|
|
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"));
|
|
1049
1026
|
}
|
|
1050
|
-
return [2 /*return*/,
|
|
1027
|
+
return [2 /*return*/, DeactivatingShares.fromSuiObjectData(typeArg, res.data)];
|
|
1051
1028
|
}
|
|
1052
1029
|
});
|
|
1053
1030
|
});
|
|
1054
1031
|
};
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
return
|
|
1032
|
+
DeactivatingShares.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::DeactivatingShares");
|
|
1033
|
+
DeactivatingShares.$numTypeParams = 1;
|
|
1034
|
+
DeactivatingShares.$isPhantom = [true];
|
|
1035
|
+
return DeactivatingShares;
|
|
1059
1036
|
}());
|
|
1060
|
-
exports.
|
|
1037
|
+
exports.DeactivatingShares = DeactivatingShares;
|
|
1061
1038
|
/* ============================== LiquidityPool =============================== */
|
|
1062
1039
|
function isLiquidityPool(type) {
|
|
1063
1040
|
type = (0, util_1.compressSuiType)(type);
|
|
@@ -1125,13 +1102,13 @@ var LiquidityPool = /** @class */ (function () {
|
|
|
1125
1102
|
Object.defineProperty(LiquidityPool, "bcs", {
|
|
1126
1103
|
get: function () {
|
|
1127
1104
|
return bcs_1.bcs.struct("LiquidityPool", {
|
|
1128
|
-
id:
|
|
1105
|
+
id: structs_3.UID.bcs,
|
|
1129
1106
|
index: bcs_1.bcs.u64(),
|
|
1130
1107
|
lp_token_type: structs_1.TypeName.bcs,
|
|
1131
1108
|
liquidity_tokens: bcs_1.bcs.vector(structs_1.TypeName.bcs),
|
|
1132
1109
|
token_pools: bcs_1.bcs.vector(TokenPool.bcs),
|
|
1133
1110
|
pool_info: LiquidityPoolInfo.bcs,
|
|
1134
|
-
liquidated_unsettled_receipts: bcs_1.bcs.vector(
|
|
1111
|
+
liquidated_unsettled_receipts: bcs_1.bcs.vector(structs_4.UnsettledBidReceipt.bcs),
|
|
1135
1112
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
1136
1113
|
bcs_padding: bcs_1.bcs.vector(bcs_1.bcs.u8()),
|
|
1137
1114
|
});
|
|
@@ -1141,13 +1118,13 @@ var LiquidityPool = /** @class */ (function () {
|
|
|
1141
1118
|
});
|
|
1142
1119
|
LiquidityPool.fromFields = function (fields) {
|
|
1143
1120
|
return LiquidityPool.reified().new({
|
|
1144
|
-
id: (0, reified_1.decodeFromFields)(
|
|
1121
|
+
id: (0, reified_1.decodeFromFields)(structs_3.UID.reified(), fields.id),
|
|
1145
1122
|
index: (0, reified_1.decodeFromFields)("u64", fields.index),
|
|
1146
1123
|
lpTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.lp_token_type),
|
|
1147
1124
|
liquidityTokens: (0, reified_1.decodeFromFields)(reified.vector(structs_1.TypeName.reified()), fields.liquidity_tokens),
|
|
1148
1125
|
tokenPools: (0, reified_1.decodeFromFields)(reified.vector(TokenPool.reified()), fields.token_pools),
|
|
1149
1126
|
poolInfo: (0, reified_1.decodeFromFields)(LiquidityPoolInfo.reified(), fields.pool_info),
|
|
1150
|
-
liquidatedUnsettledReceipts: (0, reified_1.decodeFromFields)(reified.vector(
|
|
1127
|
+
liquidatedUnsettledReceipts: (0, reified_1.decodeFromFields)(reified.vector(structs_4.UnsettledBidReceipt.reified()), fields.liquidated_unsettled_receipts),
|
|
1151
1128
|
u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
|
|
1152
1129
|
bcsPadding: (0, reified_1.decodeFromFields)(reified.vector("u8"), fields.bcs_padding),
|
|
1153
1130
|
});
|
|
@@ -1157,13 +1134,13 @@ var LiquidityPool = /** @class */ (function () {
|
|
|
1157
1134
|
throw new Error("not a LiquidityPool type");
|
|
1158
1135
|
}
|
|
1159
1136
|
return LiquidityPool.reified().new({
|
|
1160
|
-
id: (0, reified_1.decodeFromFieldsWithTypes)(
|
|
1137
|
+
id: (0, reified_1.decodeFromFieldsWithTypes)(structs_3.UID.reified(), item.fields.id),
|
|
1161
1138
|
index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
|
|
1162
1139
|
lpTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.lp_token_type),
|
|
1163
1140
|
liquidityTokens: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(structs_1.TypeName.reified()), item.fields.liquidity_tokens),
|
|
1164
1141
|
tokenPools: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(TokenPool.reified()), item.fields.token_pools),
|
|
1165
1142
|
poolInfo: (0, reified_1.decodeFromFieldsWithTypes)(LiquidityPoolInfo.reified(), item.fields.pool_info),
|
|
1166
|
-
liquidatedUnsettledReceipts: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(
|
|
1143
|
+
liquidatedUnsettledReceipts: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(structs_4.UnsettledBidReceipt.reified()), item.fields.liquidated_unsettled_receipts),
|
|
1167
1144
|
u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
|
|
1168
1145
|
bcsPadding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u8"), item.fields.bcs_padding),
|
|
1169
1146
|
});
|
|
@@ -1179,7 +1156,7 @@ var LiquidityPool = /** @class */ (function () {
|
|
|
1179
1156
|
liquidityTokens: (0, reified_1.fieldToJSON)("vector<".concat(structs_1.TypeName.$typeName, ">"), this.liquidityTokens),
|
|
1180
1157
|
tokenPools: (0, reified_1.fieldToJSON)("vector<".concat(TokenPool.$typeName, ">"), this.tokenPools),
|
|
1181
1158
|
poolInfo: this.poolInfo.toJSONField(),
|
|
1182
|
-
liquidatedUnsettledReceipts: (0, reified_1.fieldToJSON)("vector<".concat(
|
|
1159
|
+
liquidatedUnsettledReceipts: (0, reified_1.fieldToJSON)("vector<".concat(structs_4.UnsettledBidReceipt.$typeName, ">"), this.liquidatedUnsettledReceipts),
|
|
1183
1160
|
u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
|
|
1184
1161
|
bcsPadding: (0, reified_1.fieldToJSON)("vector<u8>", this.bcsPadding),
|
|
1185
1162
|
};
|
|
@@ -1189,13 +1166,13 @@ var LiquidityPool = /** @class */ (function () {
|
|
|
1189
1166
|
};
|
|
1190
1167
|
LiquidityPool.fromJSONField = function (field) {
|
|
1191
1168
|
return LiquidityPool.reified().new({
|
|
1192
|
-
id: (0, reified_1.decodeFromJSONField)(
|
|
1169
|
+
id: (0, reified_1.decodeFromJSONField)(structs_3.UID.reified(), field.id),
|
|
1193
1170
|
index: (0, reified_1.decodeFromJSONField)("u64", field.index),
|
|
1194
1171
|
lpTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.lpTokenType),
|
|
1195
1172
|
liquidityTokens: (0, reified_1.decodeFromJSONField)(reified.vector(structs_1.TypeName.reified()), field.liquidityTokens),
|
|
1196
1173
|
tokenPools: (0, reified_1.decodeFromJSONField)(reified.vector(TokenPool.reified()), field.tokenPools),
|
|
1197
1174
|
poolInfo: (0, reified_1.decodeFromJSONField)(LiquidityPoolInfo.reified(), field.poolInfo),
|
|
1198
|
-
liquidatedUnsettledReceipts: (0, reified_1.decodeFromJSONField)(reified.vector(
|
|
1175
|
+
liquidatedUnsettledReceipts: (0, reified_1.decodeFromJSONField)(reified.vector(structs_4.UnsettledBidReceipt.reified()), field.liquidatedUnsettledReceipts),
|
|
1199
1176
|
u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
|
|
1200
1177
|
bcsPadding: (0, reified_1.decodeFromJSONField)(reified.vector("u8"), field.bcsPadding),
|
|
1201
1178
|
});
|
|
@@ -2339,6 +2316,189 @@ var NewLiquidityPoolEvent = /** @class */ (function () {
|
|
|
2339
2316
|
return NewLiquidityPoolEvent;
|
|
2340
2317
|
}());
|
|
2341
2318
|
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;
|
|
2342
2502
|
/* ============================== Registry =============================== */
|
|
2343
2503
|
function isRegistry(type) {
|
|
2344
2504
|
type = (0, util_1.compressSuiType)(type);
|
|
@@ -2400,9 +2560,9 @@ var Registry = /** @class */ (function () {
|
|
|
2400
2560
|
Object.defineProperty(Registry, "bcs", {
|
|
2401
2561
|
get: function () {
|
|
2402
2562
|
return bcs_1.bcs.struct("Registry", {
|
|
2403
|
-
id:
|
|
2563
|
+
id: structs_3.UID.bcs,
|
|
2404
2564
|
num_pool: bcs_1.bcs.u64(),
|
|
2405
|
-
liquidity_pool_registry:
|
|
2565
|
+
liquidity_pool_registry: structs_3.UID.bcs,
|
|
2406
2566
|
});
|
|
2407
2567
|
},
|
|
2408
2568
|
enumerable: false,
|
|
@@ -2410,9 +2570,9 @@ var Registry = /** @class */ (function () {
|
|
|
2410
2570
|
});
|
|
2411
2571
|
Registry.fromFields = function (fields) {
|
|
2412
2572
|
return Registry.reified().new({
|
|
2413
|
-
id: (0, reified_1.decodeFromFields)(
|
|
2573
|
+
id: (0, reified_1.decodeFromFields)(structs_3.UID.reified(), fields.id),
|
|
2414
2574
|
numPool: (0, reified_1.decodeFromFields)("u64", fields.num_pool),
|
|
2415
|
-
liquidityPoolRegistry: (0, reified_1.decodeFromFields)(
|
|
2575
|
+
liquidityPoolRegistry: (0, reified_1.decodeFromFields)(structs_3.UID.reified(), fields.liquidity_pool_registry),
|
|
2416
2576
|
});
|
|
2417
2577
|
};
|
|
2418
2578
|
Registry.fromFieldsWithTypes = function (item) {
|
|
@@ -2420,9 +2580,9 @@ var Registry = /** @class */ (function () {
|
|
|
2420
2580
|
throw new Error("not a Registry type");
|
|
2421
2581
|
}
|
|
2422
2582
|
return Registry.reified().new({
|
|
2423
|
-
id: (0, reified_1.decodeFromFieldsWithTypes)(
|
|
2583
|
+
id: (0, reified_1.decodeFromFieldsWithTypes)(structs_3.UID.reified(), item.fields.id),
|
|
2424
2584
|
numPool: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.num_pool),
|
|
2425
|
-
liquidityPoolRegistry: (0, reified_1.decodeFromFieldsWithTypes)(
|
|
2585
|
+
liquidityPoolRegistry: (0, reified_1.decodeFromFieldsWithTypes)(structs_3.UID.reified(), item.fields.liquidity_pool_registry),
|
|
2426
2586
|
});
|
|
2427
2587
|
};
|
|
2428
2588
|
Registry.fromBcs = function (data) {
|
|
@@ -2440,9 +2600,9 @@ var Registry = /** @class */ (function () {
|
|
|
2440
2600
|
};
|
|
2441
2601
|
Registry.fromJSONField = function (field) {
|
|
2442
2602
|
return Registry.reified().new({
|
|
2443
|
-
id: (0, reified_1.decodeFromJSONField)(
|
|
2603
|
+
id: (0, reified_1.decodeFromJSONField)(structs_3.UID.reified(), field.id),
|
|
2444
2604
|
numPool: (0, reified_1.decodeFromJSONField)("u64", field.numPool),
|
|
2445
|
-
liquidityPoolRegistry: (0, reified_1.decodeFromJSONField)(
|
|
2605
|
+
liquidityPoolRegistry: (0, reified_1.decodeFromJSONField)(structs_3.UID.reified(), field.liquidityPoolRegistry),
|
|
2446
2606
|
});
|
|
2447
2607
|
};
|
|
2448
2608
|
Registry.fromJSON = function (json) {
|
|
@@ -5002,212 +5162,152 @@ var UpdateSpotConfigEvent = /** @class */ (function () {
|
|
|
5002
5162
|
return UpdateSpotConfigEvent;
|
|
5003
5163
|
}());
|
|
5004
5164
|
exports.UpdateSpotConfigEvent = UpdateSpotConfigEvent;
|
|
5005
|
-
/* ==============================
|
|
5006
|
-
function
|
|
5165
|
+
/* ============================== UpdateUnlockCountdownTsMsEvent =============================== */
|
|
5166
|
+
function isUpdateUnlockCountdownTsMsEvent(type) {
|
|
5007
5167
|
type = (0, util_1.compressSuiType)(type);
|
|
5008
|
-
return type === "".concat(index_1.PKG_V1, "::lp_pool::
|
|
5168
|
+
return type === "".concat(index_1.PKG_V1, "::lp_pool::UpdateUnlockCountdownTsMsEvent");
|
|
5009
5169
|
}
|
|
5010
|
-
var
|
|
5011
|
-
function
|
|
5170
|
+
var UpdateUnlockCountdownTsMsEvent = /** @class */ (function () {
|
|
5171
|
+
function UpdateUnlockCountdownTsMsEvent(typeArgs, fields) {
|
|
5012
5172
|
this.__StructClass = true;
|
|
5013
|
-
this.$typeName =
|
|
5014
|
-
this.$isPhantom =
|
|
5015
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([
|
|
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));
|
|
5016
5176
|
this.$typeArgs = typeArgs;
|
|
5177
|
+
this.sender = fields.sender;
|
|
5017
5178
|
this.index = fields.index;
|
|
5018
|
-
this.
|
|
5019
|
-
this.
|
|
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;
|
|
5179
|
+
this.previousUnlockCountdownTsMs = fields.previousUnlockCountdownTsMs;
|
|
5180
|
+
this.newUnlockCountdownTsMs = fields.newUnlockCountdownTsMs;
|
|
5031
5181
|
this.u64Padding = fields.u64Padding;
|
|
5032
5182
|
}
|
|
5033
|
-
|
|
5183
|
+
UpdateUnlockCountdownTsMsEvent.reified = function () {
|
|
5034
5184
|
var _this = this;
|
|
5035
5185
|
return {
|
|
5036
|
-
typeName:
|
|
5037
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([
|
|
5186
|
+
typeName: UpdateUnlockCountdownTsMsEvent.$typeName,
|
|
5187
|
+
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([UpdateUnlockCountdownTsMsEvent.$typeName], [], false)),
|
|
5038
5188
|
typeArgs: [],
|
|
5039
|
-
isPhantom:
|
|
5189
|
+
isPhantom: UpdateUnlockCountdownTsMsEvent.$isPhantom,
|
|
5040
5190
|
reifiedTypeArgs: [],
|
|
5041
|
-
fromFields: function (fields) { return
|
|
5042
|
-
fromFieldsWithTypes: function (item) { return
|
|
5043
|
-
fromBcs: function (data) { return
|
|
5044
|
-
bcs:
|
|
5045
|
-
fromJSONField: function (field) { return
|
|
5046
|
-
fromJSON: function (json) { return
|
|
5047
|
-
fromSuiParsedData: function (content) { return
|
|
5048
|
-
fromSuiObjectData: function (content) { return
|
|
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); },
|
|
5049
5199
|
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
5050
|
-
return [2 /*return*/,
|
|
5200
|
+
return [2 /*return*/, UpdateUnlockCountdownTsMsEvent.fetch(client, id)];
|
|
5051
5201
|
}); }); },
|
|
5052
5202
|
new: function (fields) {
|
|
5053
|
-
return new
|
|
5203
|
+
return new UpdateUnlockCountdownTsMsEvent([], fields);
|
|
5054
5204
|
},
|
|
5055
5205
|
kind: "StructClassReified",
|
|
5056
5206
|
};
|
|
5057
5207
|
};
|
|
5058
|
-
Object.defineProperty(
|
|
5208
|
+
Object.defineProperty(UpdateUnlockCountdownTsMsEvent, "r", {
|
|
5059
5209
|
get: function () {
|
|
5060
|
-
return
|
|
5210
|
+
return UpdateUnlockCountdownTsMsEvent.reified();
|
|
5061
5211
|
},
|
|
5062
5212
|
enumerable: false,
|
|
5063
5213
|
configurable: true
|
|
5064
5214
|
});
|
|
5065
|
-
|
|
5066
|
-
return (0, reified_1.phantom)(
|
|
5215
|
+
UpdateUnlockCountdownTsMsEvent.phantom = function () {
|
|
5216
|
+
return (0, reified_1.phantom)(UpdateUnlockCountdownTsMsEvent.reified());
|
|
5067
5217
|
};
|
|
5068
|
-
Object.defineProperty(
|
|
5218
|
+
Object.defineProperty(UpdateUnlockCountdownTsMsEvent, "p", {
|
|
5069
5219
|
get: function () {
|
|
5070
|
-
return
|
|
5220
|
+
return UpdateUnlockCountdownTsMsEvent.phantom();
|
|
5071
5221
|
},
|
|
5072
5222
|
enumerable: false,
|
|
5073
5223
|
configurable: true
|
|
5074
5224
|
});
|
|
5075
|
-
Object.defineProperty(
|
|
5225
|
+
Object.defineProperty(UpdateUnlockCountdownTsMsEvent, "bcs", {
|
|
5076
5226
|
get: function () {
|
|
5077
|
-
return bcs_1.bcs.struct("
|
|
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); } }),
|
|
5078
5229
|
index: bcs_1.bcs.u64(),
|
|
5079
|
-
|
|
5080
|
-
|
|
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(),
|
|
5230
|
+
previous_unlock_countdown_ts_ms: bcs_1.bcs.u64(),
|
|
5231
|
+
new_unlock_countdown_ts_ms: bcs_1.bcs.u64(),
|
|
5092
5232
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
5093
5233
|
});
|
|
5094
5234
|
},
|
|
5095
5235
|
enumerable: false,
|
|
5096
5236
|
configurable: true
|
|
5097
5237
|
});
|
|
5098
|
-
|
|
5099
|
-
return
|
|
5238
|
+
UpdateUnlockCountdownTsMsEvent.fromFields = function (fields) {
|
|
5239
|
+
return UpdateUnlockCountdownTsMsEvent.reified().new({
|
|
5240
|
+
sender: (0, reified_1.decodeFromFields)("address", fields.sender),
|
|
5100
5241
|
index: (0, reified_1.decodeFromFields)("u64", fields.index),
|
|
5101
|
-
|
|
5102
|
-
|
|
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),
|
|
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),
|
|
5114
5244
|
u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
|
|
5115
5245
|
});
|
|
5116
5246
|
};
|
|
5117
|
-
|
|
5118
|
-
if (!
|
|
5119
|
-
throw new Error("not a
|
|
5247
|
+
UpdateUnlockCountdownTsMsEvent.fromFieldsWithTypes = function (item) {
|
|
5248
|
+
if (!isUpdateUnlockCountdownTsMsEvent(item.type)) {
|
|
5249
|
+
throw new Error("not a UpdateUnlockCountdownTsMsEvent type");
|
|
5120
5250
|
}
|
|
5121
|
-
return
|
|
5251
|
+
return UpdateUnlockCountdownTsMsEvent.reified().new({
|
|
5252
|
+
sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
|
|
5122
5253
|
index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
|
|
5123
|
-
|
|
5124
|
-
|
|
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),
|
|
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),
|
|
5136
5256
|
u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
|
|
5137
5257
|
});
|
|
5138
5258
|
};
|
|
5139
|
-
|
|
5140
|
-
return
|
|
5259
|
+
UpdateUnlockCountdownTsMsEvent.fromBcs = function (data) {
|
|
5260
|
+
return UpdateUnlockCountdownTsMsEvent.fromFields(UpdateUnlockCountdownTsMsEvent.bcs.parse(data));
|
|
5141
5261
|
};
|
|
5142
|
-
|
|
5262
|
+
UpdateUnlockCountdownTsMsEvent.prototype.toJSONField = function () {
|
|
5143
5263
|
return {
|
|
5264
|
+
sender: this.sender,
|
|
5144
5265
|
index: this.index.toString(),
|
|
5145
|
-
|
|
5146
|
-
|
|
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(),
|
|
5266
|
+
previousUnlockCountdownTsMs: this.previousUnlockCountdownTsMs.toString(),
|
|
5267
|
+
newUnlockCountdownTsMs: this.newUnlockCountdownTsMs.toString(),
|
|
5158
5268
|
u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
|
|
5159
5269
|
};
|
|
5160
5270
|
};
|
|
5161
|
-
|
|
5271
|
+
UpdateUnlockCountdownTsMsEvent.prototype.toJSON = function () {
|
|
5162
5272
|
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
5163
5273
|
};
|
|
5164
|
-
|
|
5165
|
-
return
|
|
5274
|
+
UpdateUnlockCountdownTsMsEvent.fromJSONField = function (field) {
|
|
5275
|
+
return UpdateUnlockCountdownTsMsEvent.reified().new({
|
|
5276
|
+
sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
|
|
5166
5277
|
index: (0, reified_1.decodeFromJSONField)("u64", field.index),
|
|
5167
|
-
|
|
5168
|
-
|
|
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),
|
|
5278
|
+
previousUnlockCountdownTsMs: (0, reified_1.decodeFromJSONField)("u64", field.previousUnlockCountdownTsMs),
|
|
5279
|
+
newUnlockCountdownTsMs: (0, reified_1.decodeFromJSONField)("u64", field.newUnlockCountdownTsMs),
|
|
5180
5280
|
u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
|
|
5181
5281
|
});
|
|
5182
5282
|
};
|
|
5183
|
-
|
|
5184
|
-
if (json.$typeName !==
|
|
5283
|
+
UpdateUnlockCountdownTsMsEvent.fromJSON = function (json) {
|
|
5284
|
+
if (json.$typeName !== UpdateUnlockCountdownTsMsEvent.$typeName) {
|
|
5185
5285
|
throw new Error("not a WithTwoGenerics json object");
|
|
5186
5286
|
}
|
|
5187
|
-
return
|
|
5287
|
+
return UpdateUnlockCountdownTsMsEvent.fromJSONField(json);
|
|
5188
5288
|
};
|
|
5189
|
-
|
|
5289
|
+
UpdateUnlockCountdownTsMsEvent.fromSuiParsedData = function (content) {
|
|
5190
5290
|
if (content.dataType !== "moveObject") {
|
|
5191
5291
|
throw new Error("not an object");
|
|
5192
5292
|
}
|
|
5193
|
-
if (!
|
|
5194
|
-
throw new Error("object at ".concat(content.fields.id, " is not a
|
|
5293
|
+
if (!isUpdateUnlockCountdownTsMsEvent(content.type)) {
|
|
5294
|
+
throw new Error("object at ".concat(content.fields.id, " is not a UpdateUnlockCountdownTsMsEvent object"));
|
|
5195
5295
|
}
|
|
5196
|
-
return
|
|
5296
|
+
return UpdateUnlockCountdownTsMsEvent.fromFieldsWithTypes(content);
|
|
5197
5297
|
};
|
|
5198
|
-
|
|
5298
|
+
UpdateUnlockCountdownTsMsEvent.fromSuiObjectData = function (data) {
|
|
5199
5299
|
if (data.bcs) {
|
|
5200
|
-
if (data.bcs.dataType !== "moveObject" || !
|
|
5201
|
-
throw new Error("object at is not a
|
|
5300
|
+
if (data.bcs.dataType !== "moveObject" || !isUpdateUnlockCountdownTsMsEvent(data.bcs.type)) {
|
|
5301
|
+
throw new Error("object at is not a UpdateUnlockCountdownTsMsEvent object");
|
|
5202
5302
|
}
|
|
5203
|
-
return
|
|
5303
|
+
return UpdateUnlockCountdownTsMsEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
5204
5304
|
}
|
|
5205
5305
|
if (data.content) {
|
|
5206
|
-
return
|
|
5306
|
+
return UpdateUnlockCountdownTsMsEvent.fromSuiParsedData(data.content);
|
|
5207
5307
|
}
|
|
5208
5308
|
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
5209
5309
|
};
|
|
5210
|
-
|
|
5310
|
+
UpdateUnlockCountdownTsMsEvent.fetch = function (client, id) {
|
|
5211
5311
|
return __awaiter(this, void 0, void 0, function () {
|
|
5212
5312
|
var res;
|
|
5213
5313
|
var _a, _b;
|
|
@@ -5217,19 +5317,19 @@ var WithdrawLendingEvent = /** @class */ (function () {
|
|
|
5217
5317
|
case 1:
|
|
5218
5318
|
res = _c.sent();
|
|
5219
5319
|
if (res.error) {
|
|
5220
|
-
throw new Error("error fetching
|
|
5320
|
+
throw new Error("error fetching UpdateUnlockCountdownTsMsEvent object at id ".concat(id, ": ").concat(res.error.code));
|
|
5221
5321
|
}
|
|
5222
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !
|
|
5223
|
-
throw new Error("object at id ".concat(id, " is not a
|
|
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"));
|
|
5224
5324
|
}
|
|
5225
|
-
return [2 /*return*/,
|
|
5325
|
+
return [2 /*return*/, UpdateUnlockCountdownTsMsEvent.fromSuiObjectData(res.data)];
|
|
5226
5326
|
}
|
|
5227
5327
|
});
|
|
5228
5328
|
});
|
|
5229
5329
|
};
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5233
|
-
return
|
|
5330
|
+
UpdateUnlockCountdownTsMsEvent.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::UpdateUnlockCountdownTsMsEvent");
|
|
5331
|
+
UpdateUnlockCountdownTsMsEvent.$numTypeParams = 0;
|
|
5332
|
+
UpdateUnlockCountdownTsMsEvent.$isPhantom = [];
|
|
5333
|
+
return UpdateUnlockCountdownTsMsEvent;
|
|
5234
5334
|
}());
|
|
5235
|
-
exports.
|
|
5335
|
+
exports.UpdateUnlockCountdownTsMsEvent = UpdateUnlockCountdownTsMsEvent;
|