@typus/typus-perp-sdk 1.1.4 → 1.1.5-pnl
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/api/sentio.js +1 -1
- package/dist/src/fetch.d.ts +10 -1
- package/dist/src/fetch.js +21 -8
- package/dist/src/typus_perp/lp-pool/functions.d.ts +34 -0
- package/dist/src/typus_perp/lp-pool/functions.js +56 -0
- package/dist/src/typus_perp/lp-pool/structs.d.ts +774 -0
- package/dist/src/typus_perp/lp-pool/structs.js +1952 -498
- package/dist/src/typus_perp/trading/functions.d.ts +64 -2
- package/dist/src/typus_perp/trading/functions.js +93 -3
- package/dist/src/typus_perp/user-account/functions.d.ts +36 -0
- package/dist/src/typus_perp/user-account/functions.js +70 -0
- package/dist/src/typus_perp/user-account/structs.d.ts +168 -0
- package/dist/src/typus_perp/user-account/structs.js +448 -0
- package/dist/src/user/history.js +5 -4
- package/package.json +2 -2
|
@@ -105,19 +105,26 @@ 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.UpdateUnlockCountdownTsMsEvent = exports.UpdateSpotConfigEvent = exports.UpdateRebalanceCostThresholdBpEvent = 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.RebalanceProcess = exports.RebalanceEvent = exports.NewLiquidityPoolEvent = exports.MintLpEvent = exports.MarginConfig = exports.ManagerFlashRepayLiquidityEvent = exports.ManagerFlashRemoveLiquidityEvent = exports.ManagerEmergencyWithdrawEvent = exports.ManagerEmergencyDepositEvent = exports.ManagerDepositReceiptV2 = exports.ManagerDepositReceipt = exports.LiquidityPoolInfo = exports.LiquidityPool = exports.DeactivatingShares = exports.Config = exports.CompleteRemoveLiquidityTokenProcessEvent = exports.CompleteRebalancingEvent = exports.BurnLpEvent = exports.AddLiquidityTokenEvent = void 0;
|
|
109
109
|
exports.isAddLiquidityTokenEvent = isAddLiquidityTokenEvent;
|
|
110
110
|
exports.isBurnLpEvent = isBurnLpEvent;
|
|
111
|
+
exports.isCompleteRebalancingEvent = isCompleteRebalancingEvent;
|
|
111
112
|
exports.isCompleteRemoveLiquidityTokenProcessEvent = isCompleteRemoveLiquidityTokenProcessEvent;
|
|
112
113
|
exports.isConfig = isConfig;
|
|
113
114
|
exports.isDeactivatingShares = isDeactivatingShares;
|
|
114
115
|
exports.isLiquidityPool = isLiquidityPool;
|
|
115
116
|
exports.isLiquidityPoolInfo = isLiquidityPoolInfo;
|
|
117
|
+
exports.isManagerDepositReceipt = isManagerDepositReceipt;
|
|
118
|
+
exports.isManagerDepositReceiptV2 = isManagerDepositReceiptV2;
|
|
119
|
+
exports.isManagerEmergencyDepositEvent = isManagerEmergencyDepositEvent;
|
|
120
|
+
exports.isManagerEmergencyWithdrawEvent = isManagerEmergencyWithdrawEvent;
|
|
116
121
|
exports.isManagerFlashRemoveLiquidityEvent = isManagerFlashRemoveLiquidityEvent;
|
|
117
122
|
exports.isManagerFlashRepayLiquidityEvent = isManagerFlashRepayLiquidityEvent;
|
|
118
123
|
exports.isMarginConfig = isMarginConfig;
|
|
119
124
|
exports.isMintLpEvent = isMintLpEvent;
|
|
120
125
|
exports.isNewLiquidityPoolEvent = isNewLiquidityPoolEvent;
|
|
126
|
+
exports.isRebalanceEvent = isRebalanceEvent;
|
|
127
|
+
exports.isRebalanceProcess = isRebalanceProcess;
|
|
121
128
|
exports.isRedeemEvent = isRedeemEvent;
|
|
122
129
|
exports.isRegistry = isRegistry;
|
|
123
130
|
exports.isRemoveLiquidityTokenProcess = isRemoveLiquidityTokenProcess;
|
|
@@ -133,6 +140,7 @@ exports.isTokenPool = isTokenPool;
|
|
|
133
140
|
exports.isUpdateBorrowInfoEvent = isUpdateBorrowInfoEvent;
|
|
134
141
|
exports.isUpdateLiquidityValueEvent = isUpdateLiquidityValueEvent;
|
|
135
142
|
exports.isUpdateMarginConfigEvent = isUpdateMarginConfigEvent;
|
|
143
|
+
exports.isUpdateRebalanceCostThresholdBpEvent = isUpdateRebalanceCostThresholdBpEvent;
|
|
136
144
|
exports.isUpdateSpotConfigEvent = isUpdateSpotConfigEvent;
|
|
137
145
|
exports.isUpdateUnlockCountdownTsMsEvent = isUpdateUnlockCountdownTsMsEvent;
|
|
138
146
|
var reified = __importStar(require("../../_framework/reified"));
|
|
@@ -517,6 +525,207 @@ var BurnLpEvent = /** @class */ (function () {
|
|
|
517
525
|
return BurnLpEvent;
|
|
518
526
|
}());
|
|
519
527
|
exports.BurnLpEvent = BurnLpEvent;
|
|
528
|
+
/* ============================== CompleteRebalancingEvent =============================== */
|
|
529
|
+
function isCompleteRebalancingEvent(type) {
|
|
530
|
+
type = (0, util_1.compressSuiType)(type);
|
|
531
|
+
return type === "".concat(index_1.PKG_V1, "::lp_pool::CompleteRebalancingEvent");
|
|
532
|
+
}
|
|
533
|
+
var CompleteRebalancingEvent = /** @class */ (function () {
|
|
534
|
+
function CompleteRebalancingEvent(typeArgs, fields) {
|
|
535
|
+
this.__StructClass = true;
|
|
536
|
+
this.$typeName = CompleteRebalancingEvent.$typeName;
|
|
537
|
+
this.$isPhantom = CompleteRebalancingEvent.$isPhantom;
|
|
538
|
+
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([CompleteRebalancingEvent.$typeName], __read(typeArgs), false));
|
|
539
|
+
this.$typeArgs = typeArgs;
|
|
540
|
+
this.index = fields.index;
|
|
541
|
+
this.fromToken = fields.fromToken;
|
|
542
|
+
this.toToken = fields.toToken;
|
|
543
|
+
this.fromTokenOraclePrice = fields.fromTokenOraclePrice;
|
|
544
|
+
this.toTokenOraclePrice = fields.toTokenOraclePrice;
|
|
545
|
+
this.swappedBackUsd = fields.swappedBackUsd;
|
|
546
|
+
this.tvlUsd = fields.tvlUsd;
|
|
547
|
+
this.fromTokenLiquidityAmount = fields.fromTokenLiquidityAmount;
|
|
548
|
+
this.toTokenLiquidityAmount = fields.toTokenLiquidityAmount;
|
|
549
|
+
this.u64Padding = fields.u64Padding;
|
|
550
|
+
}
|
|
551
|
+
CompleteRebalancingEvent.reified = function () {
|
|
552
|
+
var _this = this;
|
|
553
|
+
return {
|
|
554
|
+
typeName: CompleteRebalancingEvent.$typeName,
|
|
555
|
+
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([CompleteRebalancingEvent.$typeName], [], false)),
|
|
556
|
+
typeArgs: [],
|
|
557
|
+
isPhantom: CompleteRebalancingEvent.$isPhantom,
|
|
558
|
+
reifiedTypeArgs: [],
|
|
559
|
+
fromFields: function (fields) { return CompleteRebalancingEvent.fromFields(fields); },
|
|
560
|
+
fromFieldsWithTypes: function (item) { return CompleteRebalancingEvent.fromFieldsWithTypes(item); },
|
|
561
|
+
fromBcs: function (data) { return CompleteRebalancingEvent.fromBcs(data); },
|
|
562
|
+
bcs: CompleteRebalancingEvent.bcs,
|
|
563
|
+
fromJSONField: function (field) { return CompleteRebalancingEvent.fromJSONField(field); },
|
|
564
|
+
fromJSON: function (json) { return CompleteRebalancingEvent.fromJSON(json); },
|
|
565
|
+
fromSuiParsedData: function (content) { return CompleteRebalancingEvent.fromSuiParsedData(content); },
|
|
566
|
+
fromSuiObjectData: function (content) { return CompleteRebalancingEvent.fromSuiObjectData(content); },
|
|
567
|
+
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
568
|
+
return [2 /*return*/, CompleteRebalancingEvent.fetch(client, id)];
|
|
569
|
+
}); }); },
|
|
570
|
+
new: function (fields) {
|
|
571
|
+
return new CompleteRebalancingEvent([], fields);
|
|
572
|
+
},
|
|
573
|
+
kind: "StructClassReified",
|
|
574
|
+
};
|
|
575
|
+
};
|
|
576
|
+
Object.defineProperty(CompleteRebalancingEvent, "r", {
|
|
577
|
+
get: function () {
|
|
578
|
+
return CompleteRebalancingEvent.reified();
|
|
579
|
+
},
|
|
580
|
+
enumerable: false,
|
|
581
|
+
configurable: true
|
|
582
|
+
});
|
|
583
|
+
CompleteRebalancingEvent.phantom = function () {
|
|
584
|
+
return (0, reified_1.phantom)(CompleteRebalancingEvent.reified());
|
|
585
|
+
};
|
|
586
|
+
Object.defineProperty(CompleteRebalancingEvent, "p", {
|
|
587
|
+
get: function () {
|
|
588
|
+
return CompleteRebalancingEvent.phantom();
|
|
589
|
+
},
|
|
590
|
+
enumerable: false,
|
|
591
|
+
configurable: true
|
|
592
|
+
});
|
|
593
|
+
Object.defineProperty(CompleteRebalancingEvent, "bcs", {
|
|
594
|
+
get: function () {
|
|
595
|
+
return bcs_1.bcs.struct("CompleteRebalancingEvent", {
|
|
596
|
+
index: bcs_1.bcs.u64(),
|
|
597
|
+
from_token: structs_1.TypeName.bcs,
|
|
598
|
+
to_token: structs_1.TypeName.bcs,
|
|
599
|
+
from_token_oracle_price: bcs_1.bcs.u64(),
|
|
600
|
+
to_token_oracle_price: bcs_1.bcs.u64(),
|
|
601
|
+
swapped_back_usd: bcs_1.bcs.u64(),
|
|
602
|
+
tvl_usd: bcs_1.bcs.u64(),
|
|
603
|
+
from_token_liquidity_amount: bcs_1.bcs.u64(),
|
|
604
|
+
to_token_liquidity_amount: bcs_1.bcs.u64(),
|
|
605
|
+
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
606
|
+
});
|
|
607
|
+
},
|
|
608
|
+
enumerable: false,
|
|
609
|
+
configurable: true
|
|
610
|
+
});
|
|
611
|
+
CompleteRebalancingEvent.fromFields = function (fields) {
|
|
612
|
+
return CompleteRebalancingEvent.reified().new({
|
|
613
|
+
index: (0, reified_1.decodeFromFields)("u64", fields.index),
|
|
614
|
+
fromToken: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.from_token),
|
|
615
|
+
toToken: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.to_token),
|
|
616
|
+
fromTokenOraclePrice: (0, reified_1.decodeFromFields)("u64", fields.from_token_oracle_price),
|
|
617
|
+
toTokenOraclePrice: (0, reified_1.decodeFromFields)("u64", fields.to_token_oracle_price),
|
|
618
|
+
swappedBackUsd: (0, reified_1.decodeFromFields)("u64", fields.swapped_back_usd),
|
|
619
|
+
tvlUsd: (0, reified_1.decodeFromFields)("u64", fields.tvl_usd),
|
|
620
|
+
fromTokenLiquidityAmount: (0, reified_1.decodeFromFields)("u64", fields.from_token_liquidity_amount),
|
|
621
|
+
toTokenLiquidityAmount: (0, reified_1.decodeFromFields)("u64", fields.to_token_liquidity_amount),
|
|
622
|
+
u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
|
|
623
|
+
});
|
|
624
|
+
};
|
|
625
|
+
CompleteRebalancingEvent.fromFieldsWithTypes = function (item) {
|
|
626
|
+
if (!isCompleteRebalancingEvent(item.type)) {
|
|
627
|
+
throw new Error("not a CompleteRebalancingEvent type");
|
|
628
|
+
}
|
|
629
|
+
return CompleteRebalancingEvent.reified().new({
|
|
630
|
+
index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
|
|
631
|
+
fromToken: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.from_token),
|
|
632
|
+
toToken: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.to_token),
|
|
633
|
+
fromTokenOraclePrice: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.from_token_oracle_price),
|
|
634
|
+
toTokenOraclePrice: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.to_token_oracle_price),
|
|
635
|
+
swappedBackUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.swapped_back_usd),
|
|
636
|
+
tvlUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.tvl_usd),
|
|
637
|
+
fromTokenLiquidityAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.from_token_liquidity_amount),
|
|
638
|
+
toTokenLiquidityAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.to_token_liquidity_amount),
|
|
639
|
+
u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
|
|
640
|
+
});
|
|
641
|
+
};
|
|
642
|
+
CompleteRebalancingEvent.fromBcs = function (data) {
|
|
643
|
+
return CompleteRebalancingEvent.fromFields(CompleteRebalancingEvent.bcs.parse(data));
|
|
644
|
+
};
|
|
645
|
+
CompleteRebalancingEvent.prototype.toJSONField = function () {
|
|
646
|
+
return {
|
|
647
|
+
index: this.index.toString(),
|
|
648
|
+
fromToken: this.fromToken.toJSONField(),
|
|
649
|
+
toToken: this.toToken.toJSONField(),
|
|
650
|
+
fromTokenOraclePrice: this.fromTokenOraclePrice.toString(),
|
|
651
|
+
toTokenOraclePrice: this.toTokenOraclePrice.toString(),
|
|
652
|
+
swappedBackUsd: this.swappedBackUsd.toString(),
|
|
653
|
+
tvlUsd: this.tvlUsd.toString(),
|
|
654
|
+
fromTokenLiquidityAmount: this.fromTokenLiquidityAmount.toString(),
|
|
655
|
+
toTokenLiquidityAmount: this.toTokenLiquidityAmount.toString(),
|
|
656
|
+
u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
|
|
657
|
+
};
|
|
658
|
+
};
|
|
659
|
+
CompleteRebalancingEvent.prototype.toJSON = function () {
|
|
660
|
+
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
661
|
+
};
|
|
662
|
+
CompleteRebalancingEvent.fromJSONField = function (field) {
|
|
663
|
+
return CompleteRebalancingEvent.reified().new({
|
|
664
|
+
index: (0, reified_1.decodeFromJSONField)("u64", field.index),
|
|
665
|
+
fromToken: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.fromToken),
|
|
666
|
+
toToken: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.toToken),
|
|
667
|
+
fromTokenOraclePrice: (0, reified_1.decodeFromJSONField)("u64", field.fromTokenOraclePrice),
|
|
668
|
+
toTokenOraclePrice: (0, reified_1.decodeFromJSONField)("u64", field.toTokenOraclePrice),
|
|
669
|
+
swappedBackUsd: (0, reified_1.decodeFromJSONField)("u64", field.swappedBackUsd),
|
|
670
|
+
tvlUsd: (0, reified_1.decodeFromJSONField)("u64", field.tvlUsd),
|
|
671
|
+
fromTokenLiquidityAmount: (0, reified_1.decodeFromJSONField)("u64", field.fromTokenLiquidityAmount),
|
|
672
|
+
toTokenLiquidityAmount: (0, reified_1.decodeFromJSONField)("u64", field.toTokenLiquidityAmount),
|
|
673
|
+
u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
|
|
674
|
+
});
|
|
675
|
+
};
|
|
676
|
+
CompleteRebalancingEvent.fromJSON = function (json) {
|
|
677
|
+
if (json.$typeName !== CompleteRebalancingEvent.$typeName) {
|
|
678
|
+
throw new Error("not a WithTwoGenerics json object");
|
|
679
|
+
}
|
|
680
|
+
return CompleteRebalancingEvent.fromJSONField(json);
|
|
681
|
+
};
|
|
682
|
+
CompleteRebalancingEvent.fromSuiParsedData = function (content) {
|
|
683
|
+
if (content.dataType !== "moveObject") {
|
|
684
|
+
throw new Error("not an object");
|
|
685
|
+
}
|
|
686
|
+
if (!isCompleteRebalancingEvent(content.type)) {
|
|
687
|
+
throw new Error("object at ".concat(content.fields.id, " is not a CompleteRebalancingEvent object"));
|
|
688
|
+
}
|
|
689
|
+
return CompleteRebalancingEvent.fromFieldsWithTypes(content);
|
|
690
|
+
};
|
|
691
|
+
CompleteRebalancingEvent.fromSuiObjectData = function (data) {
|
|
692
|
+
if (data.bcs) {
|
|
693
|
+
if (data.bcs.dataType !== "moveObject" || !isCompleteRebalancingEvent(data.bcs.type)) {
|
|
694
|
+
throw new Error("object at is not a CompleteRebalancingEvent object");
|
|
695
|
+
}
|
|
696
|
+
return CompleteRebalancingEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
697
|
+
}
|
|
698
|
+
if (data.content) {
|
|
699
|
+
return CompleteRebalancingEvent.fromSuiParsedData(data.content);
|
|
700
|
+
}
|
|
701
|
+
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
702
|
+
};
|
|
703
|
+
CompleteRebalancingEvent.fetch = function (client, id) {
|
|
704
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
705
|
+
var res;
|
|
706
|
+
var _a, _b;
|
|
707
|
+
return __generator(this, function (_c) {
|
|
708
|
+
switch (_c.label) {
|
|
709
|
+
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
710
|
+
case 1:
|
|
711
|
+
res = _c.sent();
|
|
712
|
+
if (res.error) {
|
|
713
|
+
throw new Error("error fetching CompleteRebalancingEvent object at id ".concat(id, ": ").concat(res.error.code));
|
|
714
|
+
}
|
|
715
|
+
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isCompleteRebalancingEvent(res.data.bcs.type)) {
|
|
716
|
+
throw new Error("object at id ".concat(id, " is not a CompleteRebalancingEvent object"));
|
|
717
|
+
}
|
|
718
|
+
return [2 /*return*/, CompleteRebalancingEvent.fromSuiObjectData(res.data)];
|
|
719
|
+
}
|
|
720
|
+
});
|
|
721
|
+
});
|
|
722
|
+
};
|
|
723
|
+
CompleteRebalancingEvent.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::CompleteRebalancingEvent");
|
|
724
|
+
CompleteRebalancingEvent.$numTypeParams = 0;
|
|
725
|
+
CompleteRebalancingEvent.$isPhantom = [];
|
|
726
|
+
return CompleteRebalancingEvent;
|
|
727
|
+
}());
|
|
728
|
+
exports.CompleteRebalancingEvent = CompleteRebalancingEvent;
|
|
520
729
|
/* ============================== CompleteRemoveLiquidityTokenProcessEvent =============================== */
|
|
521
730
|
function isCompleteRemoveLiquidityTokenProcessEvent(type) {
|
|
522
731
|
type = (0, util_1.compressSuiType)(type);
|
|
@@ -1395,164 +1604,140 @@ var LiquidityPoolInfo = /** @class */ (function () {
|
|
|
1395
1604
|
return LiquidityPoolInfo;
|
|
1396
1605
|
}());
|
|
1397
1606
|
exports.LiquidityPoolInfo = LiquidityPoolInfo;
|
|
1398
|
-
/* ==============================
|
|
1399
|
-
function
|
|
1607
|
+
/* ============================== ManagerDepositReceipt =============================== */
|
|
1608
|
+
function isManagerDepositReceipt(type) {
|
|
1400
1609
|
type = (0, util_1.compressSuiType)(type);
|
|
1401
|
-
return type === "".concat(index_1.PKG_V1, "::lp_pool::
|
|
1610
|
+
return type === "".concat(index_1.PKG_V1, "::lp_pool::ManagerDepositReceipt");
|
|
1402
1611
|
}
|
|
1403
|
-
var
|
|
1404
|
-
function
|
|
1612
|
+
var ManagerDepositReceipt = /** @class */ (function () {
|
|
1613
|
+
function ManagerDepositReceipt(typeArgs, fields) {
|
|
1405
1614
|
this.__StructClass = true;
|
|
1406
|
-
this.$typeName =
|
|
1407
|
-
this.$isPhantom =
|
|
1408
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([
|
|
1615
|
+
this.$typeName = ManagerDepositReceipt.$typeName;
|
|
1616
|
+
this.$isPhantom = ManagerDepositReceipt.$isPhantom;
|
|
1617
|
+
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([ManagerDepositReceipt.$typeName], __read(typeArgs), false));
|
|
1409
1618
|
this.$typeArgs = typeArgs;
|
|
1410
|
-
this.
|
|
1411
|
-
this.
|
|
1412
|
-
this.
|
|
1413
|
-
this.priceDecimal = fields.priceDecimal;
|
|
1414
|
-
this.removeAmount = fields.removeAmount;
|
|
1415
|
-
this.removedUsd = fields.removedUsd;
|
|
1416
|
-
this.u64Padding = fields.u64Padding;
|
|
1619
|
+
this.id = fields.id;
|
|
1620
|
+
this.tokenType = fields.tokenType;
|
|
1621
|
+
this.amount = fields.amount;
|
|
1417
1622
|
}
|
|
1418
|
-
|
|
1623
|
+
ManagerDepositReceipt.reified = function () {
|
|
1419
1624
|
var _this = this;
|
|
1420
1625
|
return {
|
|
1421
|
-
typeName:
|
|
1422
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([
|
|
1626
|
+
typeName: ManagerDepositReceipt.$typeName,
|
|
1627
|
+
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([ManagerDepositReceipt.$typeName], [], false)),
|
|
1423
1628
|
typeArgs: [],
|
|
1424
|
-
isPhantom:
|
|
1629
|
+
isPhantom: ManagerDepositReceipt.$isPhantom,
|
|
1425
1630
|
reifiedTypeArgs: [],
|
|
1426
|
-
fromFields: function (fields) { return
|
|
1427
|
-
fromFieldsWithTypes: function (item) { return
|
|
1428
|
-
fromBcs: function (data) { return
|
|
1429
|
-
bcs:
|
|
1430
|
-
fromJSONField: function (field) { return
|
|
1431
|
-
fromJSON: function (json) { return
|
|
1432
|
-
fromSuiParsedData: function (content) { return
|
|
1433
|
-
fromSuiObjectData: function (content) { return
|
|
1631
|
+
fromFields: function (fields) { return ManagerDepositReceipt.fromFields(fields); },
|
|
1632
|
+
fromFieldsWithTypes: function (item) { return ManagerDepositReceipt.fromFieldsWithTypes(item); },
|
|
1633
|
+
fromBcs: function (data) { return ManagerDepositReceipt.fromBcs(data); },
|
|
1634
|
+
bcs: ManagerDepositReceipt.bcs,
|
|
1635
|
+
fromJSONField: function (field) { return ManagerDepositReceipt.fromJSONField(field); },
|
|
1636
|
+
fromJSON: function (json) { return ManagerDepositReceipt.fromJSON(json); },
|
|
1637
|
+
fromSuiParsedData: function (content) { return ManagerDepositReceipt.fromSuiParsedData(content); },
|
|
1638
|
+
fromSuiObjectData: function (content) { return ManagerDepositReceipt.fromSuiObjectData(content); },
|
|
1434
1639
|
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
1435
|
-
return [2 /*return*/,
|
|
1640
|
+
return [2 /*return*/, ManagerDepositReceipt.fetch(client, id)];
|
|
1436
1641
|
}); }); },
|
|
1437
1642
|
new: function (fields) {
|
|
1438
|
-
return new
|
|
1643
|
+
return new ManagerDepositReceipt([], fields);
|
|
1439
1644
|
},
|
|
1440
1645
|
kind: "StructClassReified",
|
|
1441
1646
|
};
|
|
1442
1647
|
};
|
|
1443
|
-
Object.defineProperty(
|
|
1648
|
+
Object.defineProperty(ManagerDepositReceipt, "r", {
|
|
1444
1649
|
get: function () {
|
|
1445
|
-
return
|
|
1650
|
+
return ManagerDepositReceipt.reified();
|
|
1446
1651
|
},
|
|
1447
1652
|
enumerable: false,
|
|
1448
1653
|
configurable: true
|
|
1449
1654
|
});
|
|
1450
|
-
|
|
1451
|
-
return (0, reified_1.phantom)(
|
|
1655
|
+
ManagerDepositReceipt.phantom = function () {
|
|
1656
|
+
return (0, reified_1.phantom)(ManagerDepositReceipt.reified());
|
|
1452
1657
|
};
|
|
1453
|
-
Object.defineProperty(
|
|
1658
|
+
Object.defineProperty(ManagerDepositReceipt, "p", {
|
|
1454
1659
|
get: function () {
|
|
1455
|
-
return
|
|
1660
|
+
return ManagerDepositReceipt.phantom();
|
|
1456
1661
|
},
|
|
1457
1662
|
enumerable: false,
|
|
1458
1663
|
configurable: true
|
|
1459
1664
|
});
|
|
1460
|
-
Object.defineProperty(
|
|
1665
|
+
Object.defineProperty(ManagerDepositReceipt, "bcs", {
|
|
1461
1666
|
get: function () {
|
|
1462
|
-
return bcs_1.bcs.struct("
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
price_decimal: bcs_1.bcs.u64(),
|
|
1467
|
-
remove_amount: bcs_1.bcs.u64(),
|
|
1468
|
-
removed_usd: bcs_1.bcs.u64(),
|
|
1469
|
-
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
1667
|
+
return bcs_1.bcs.struct("ManagerDepositReceipt", {
|
|
1668
|
+
id: structs_3.UID.bcs,
|
|
1669
|
+
token_type: structs_1.TypeName.bcs,
|
|
1670
|
+
amount: bcs_1.bcs.u64(),
|
|
1470
1671
|
});
|
|
1471
1672
|
},
|
|
1472
1673
|
enumerable: false,
|
|
1473
1674
|
configurable: true
|
|
1474
1675
|
});
|
|
1475
|
-
|
|
1476
|
-
return
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
priceDecimal: (0, reified_1.decodeFromFields)("u64", fields.price_decimal),
|
|
1481
|
-
removeAmount: (0, reified_1.decodeFromFields)("u64", fields.remove_amount),
|
|
1482
|
-
removedUsd: (0, reified_1.decodeFromFields)("u64", fields.removed_usd),
|
|
1483
|
-
u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
|
|
1676
|
+
ManagerDepositReceipt.fromFields = function (fields) {
|
|
1677
|
+
return ManagerDepositReceipt.reified().new({
|
|
1678
|
+
id: (0, reified_1.decodeFromFields)(structs_3.UID.reified(), fields.id),
|
|
1679
|
+
tokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.token_type),
|
|
1680
|
+
amount: (0, reified_1.decodeFromFields)("u64", fields.amount),
|
|
1484
1681
|
});
|
|
1485
1682
|
};
|
|
1486
|
-
|
|
1487
|
-
if (!
|
|
1488
|
-
throw new Error("not a
|
|
1683
|
+
ManagerDepositReceipt.fromFieldsWithTypes = function (item) {
|
|
1684
|
+
if (!isManagerDepositReceipt(item.type)) {
|
|
1685
|
+
throw new Error("not a ManagerDepositReceipt type");
|
|
1489
1686
|
}
|
|
1490
|
-
return
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
priceDecimal: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.price_decimal),
|
|
1495
|
-
removeAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.remove_amount),
|
|
1496
|
-
removedUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.removed_usd),
|
|
1497
|
-
u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
|
|
1687
|
+
return ManagerDepositReceipt.reified().new({
|
|
1688
|
+
id: (0, reified_1.decodeFromFieldsWithTypes)(structs_3.UID.reified(), item.fields.id),
|
|
1689
|
+
tokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.token_type),
|
|
1690
|
+
amount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.amount),
|
|
1498
1691
|
});
|
|
1499
1692
|
};
|
|
1500
|
-
|
|
1501
|
-
return
|
|
1693
|
+
ManagerDepositReceipt.fromBcs = function (data) {
|
|
1694
|
+
return ManagerDepositReceipt.fromFields(ManagerDepositReceipt.bcs.parse(data));
|
|
1502
1695
|
};
|
|
1503
|
-
|
|
1696
|
+
ManagerDepositReceipt.prototype.toJSONField = function () {
|
|
1504
1697
|
return {
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
priceDecimal: this.priceDecimal.toString(),
|
|
1509
|
-
removeAmount: this.removeAmount.toString(),
|
|
1510
|
-
removedUsd: this.removedUsd.toString(),
|
|
1511
|
-
u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
|
|
1698
|
+
id: this.id,
|
|
1699
|
+
tokenType: this.tokenType.toJSONField(),
|
|
1700
|
+
amount: this.amount.toString(),
|
|
1512
1701
|
};
|
|
1513
1702
|
};
|
|
1514
|
-
|
|
1703
|
+
ManagerDepositReceipt.prototype.toJSON = function () {
|
|
1515
1704
|
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
1516
1705
|
};
|
|
1517
|
-
|
|
1518
|
-
return
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
priceDecimal: (0, reified_1.decodeFromJSONField)("u64", field.priceDecimal),
|
|
1523
|
-
removeAmount: (0, reified_1.decodeFromJSONField)("u64", field.removeAmount),
|
|
1524
|
-
removedUsd: (0, reified_1.decodeFromJSONField)("u64", field.removedUsd),
|
|
1525
|
-
u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
|
|
1706
|
+
ManagerDepositReceipt.fromJSONField = function (field) {
|
|
1707
|
+
return ManagerDepositReceipt.reified().new({
|
|
1708
|
+
id: (0, reified_1.decodeFromJSONField)(structs_3.UID.reified(), field.id),
|
|
1709
|
+
tokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.tokenType),
|
|
1710
|
+
amount: (0, reified_1.decodeFromJSONField)("u64", field.amount),
|
|
1526
1711
|
});
|
|
1527
1712
|
};
|
|
1528
|
-
|
|
1529
|
-
if (json.$typeName !==
|
|
1713
|
+
ManagerDepositReceipt.fromJSON = function (json) {
|
|
1714
|
+
if (json.$typeName !== ManagerDepositReceipt.$typeName) {
|
|
1530
1715
|
throw new Error("not a WithTwoGenerics json object");
|
|
1531
1716
|
}
|
|
1532
|
-
return
|
|
1717
|
+
return ManagerDepositReceipt.fromJSONField(json);
|
|
1533
1718
|
};
|
|
1534
|
-
|
|
1719
|
+
ManagerDepositReceipt.fromSuiParsedData = function (content) {
|
|
1535
1720
|
if (content.dataType !== "moveObject") {
|
|
1536
1721
|
throw new Error("not an object");
|
|
1537
1722
|
}
|
|
1538
|
-
if (!
|
|
1539
|
-
throw new Error("object at ".concat(content.fields.id, " is not a
|
|
1723
|
+
if (!isManagerDepositReceipt(content.type)) {
|
|
1724
|
+
throw new Error("object at ".concat(content.fields.id, " is not a ManagerDepositReceipt object"));
|
|
1540
1725
|
}
|
|
1541
|
-
return
|
|
1726
|
+
return ManagerDepositReceipt.fromFieldsWithTypes(content);
|
|
1542
1727
|
};
|
|
1543
|
-
|
|
1728
|
+
ManagerDepositReceipt.fromSuiObjectData = function (data) {
|
|
1544
1729
|
if (data.bcs) {
|
|
1545
|
-
if (data.bcs.dataType !== "moveObject" || !
|
|
1546
|
-
throw new Error("object at is not a
|
|
1730
|
+
if (data.bcs.dataType !== "moveObject" || !isManagerDepositReceipt(data.bcs.type)) {
|
|
1731
|
+
throw new Error("object at is not a ManagerDepositReceipt object");
|
|
1547
1732
|
}
|
|
1548
|
-
return
|
|
1733
|
+
return ManagerDepositReceipt.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
1549
1734
|
}
|
|
1550
1735
|
if (data.content) {
|
|
1551
|
-
return
|
|
1736
|
+
return ManagerDepositReceipt.fromSuiParsedData(data.content);
|
|
1552
1737
|
}
|
|
1553
1738
|
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
1554
1739
|
};
|
|
1555
|
-
|
|
1740
|
+
ManagerDepositReceipt.fetch = function (client, id) {
|
|
1556
1741
|
return __awaiter(this, void 0, void 0, function () {
|
|
1557
1742
|
var res;
|
|
1558
1743
|
var _a, _b;
|
|
@@ -1562,180 +1747,168 @@ var ManagerFlashRemoveLiquidityEvent = /** @class */ (function () {
|
|
|
1562
1747
|
case 1:
|
|
1563
1748
|
res = _c.sent();
|
|
1564
1749
|
if (res.error) {
|
|
1565
|
-
throw new Error("error fetching
|
|
1750
|
+
throw new Error("error fetching ManagerDepositReceipt object at id ".concat(id, ": ").concat(res.error.code));
|
|
1566
1751
|
}
|
|
1567
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !
|
|
1568
|
-
throw new Error("object at id ".concat(id, " is not a
|
|
1752
|
+
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isManagerDepositReceipt(res.data.bcs.type)) {
|
|
1753
|
+
throw new Error("object at id ".concat(id, " is not a ManagerDepositReceipt object"));
|
|
1569
1754
|
}
|
|
1570
|
-
return [2 /*return*/,
|
|
1755
|
+
return [2 /*return*/, ManagerDepositReceipt.fromSuiObjectData(res.data)];
|
|
1571
1756
|
}
|
|
1572
1757
|
});
|
|
1573
1758
|
});
|
|
1574
1759
|
};
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
return
|
|
1760
|
+
ManagerDepositReceipt.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::ManagerDepositReceipt");
|
|
1761
|
+
ManagerDepositReceipt.$numTypeParams = 0;
|
|
1762
|
+
ManagerDepositReceipt.$isPhantom = [];
|
|
1763
|
+
return ManagerDepositReceipt;
|
|
1579
1764
|
}());
|
|
1580
|
-
exports.
|
|
1581
|
-
/* ==============================
|
|
1582
|
-
function
|
|
1765
|
+
exports.ManagerDepositReceipt = ManagerDepositReceipt;
|
|
1766
|
+
/* ============================== ManagerDepositReceiptV2 =============================== */
|
|
1767
|
+
function isManagerDepositReceiptV2(type) {
|
|
1583
1768
|
type = (0, util_1.compressSuiType)(type);
|
|
1584
|
-
return type === "".concat(index_1.PKG_V1, "::lp_pool::
|
|
1769
|
+
return type === "".concat(index_1.PKG_V1, "::lp_pool::ManagerDepositReceiptV2");
|
|
1585
1770
|
}
|
|
1586
|
-
var
|
|
1587
|
-
function
|
|
1771
|
+
var ManagerDepositReceiptV2 = /** @class */ (function () {
|
|
1772
|
+
function ManagerDepositReceiptV2(typeArgs, fields) {
|
|
1588
1773
|
this.__StructClass = true;
|
|
1589
|
-
this.$typeName =
|
|
1590
|
-
this.$isPhantom =
|
|
1591
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([
|
|
1774
|
+
this.$typeName = ManagerDepositReceiptV2.$typeName;
|
|
1775
|
+
this.$isPhantom = ManagerDepositReceiptV2.$isPhantom;
|
|
1776
|
+
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([ManagerDepositReceiptV2.$typeName], __read(typeArgs), false));
|
|
1592
1777
|
this.$typeArgs = typeArgs;
|
|
1778
|
+
this.id = fields.id;
|
|
1593
1779
|
this.index = fields.index;
|
|
1594
|
-
this.
|
|
1595
|
-
this.
|
|
1596
|
-
this.priceDecimal = fields.priceDecimal;
|
|
1597
|
-
this.repaidAmount = fields.repaidAmount;
|
|
1598
|
-
this.repaidUsd = fields.repaidUsd;
|
|
1780
|
+
this.tokenType = fields.tokenType;
|
|
1781
|
+
this.amount = fields.amount;
|
|
1599
1782
|
this.u64Padding = fields.u64Padding;
|
|
1600
1783
|
}
|
|
1601
|
-
|
|
1784
|
+
ManagerDepositReceiptV2.reified = function () {
|
|
1602
1785
|
var _this = this;
|
|
1603
1786
|
return {
|
|
1604
|
-
typeName:
|
|
1605
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([
|
|
1787
|
+
typeName: ManagerDepositReceiptV2.$typeName,
|
|
1788
|
+
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([ManagerDepositReceiptV2.$typeName], [], false)),
|
|
1606
1789
|
typeArgs: [],
|
|
1607
|
-
isPhantom:
|
|
1790
|
+
isPhantom: ManagerDepositReceiptV2.$isPhantom,
|
|
1608
1791
|
reifiedTypeArgs: [],
|
|
1609
|
-
fromFields: function (fields) { return
|
|
1610
|
-
fromFieldsWithTypes: function (item) { return
|
|
1611
|
-
fromBcs: function (data) { return
|
|
1612
|
-
bcs:
|
|
1613
|
-
fromJSONField: function (field) { return
|
|
1614
|
-
fromJSON: function (json) { return
|
|
1615
|
-
fromSuiParsedData: function (content) { return
|
|
1616
|
-
fromSuiObjectData: function (content) { return
|
|
1792
|
+
fromFields: function (fields) { return ManagerDepositReceiptV2.fromFields(fields); },
|
|
1793
|
+
fromFieldsWithTypes: function (item) { return ManagerDepositReceiptV2.fromFieldsWithTypes(item); },
|
|
1794
|
+
fromBcs: function (data) { return ManagerDepositReceiptV2.fromBcs(data); },
|
|
1795
|
+
bcs: ManagerDepositReceiptV2.bcs,
|
|
1796
|
+
fromJSONField: function (field) { return ManagerDepositReceiptV2.fromJSONField(field); },
|
|
1797
|
+
fromJSON: function (json) { return ManagerDepositReceiptV2.fromJSON(json); },
|
|
1798
|
+
fromSuiParsedData: function (content) { return ManagerDepositReceiptV2.fromSuiParsedData(content); },
|
|
1799
|
+
fromSuiObjectData: function (content) { return ManagerDepositReceiptV2.fromSuiObjectData(content); },
|
|
1617
1800
|
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
1618
|
-
return [2 /*return*/,
|
|
1801
|
+
return [2 /*return*/, ManagerDepositReceiptV2.fetch(client, id)];
|
|
1619
1802
|
}); }); },
|
|
1620
1803
|
new: function (fields) {
|
|
1621
|
-
return new
|
|
1804
|
+
return new ManagerDepositReceiptV2([], fields);
|
|
1622
1805
|
},
|
|
1623
1806
|
kind: "StructClassReified",
|
|
1624
1807
|
};
|
|
1625
1808
|
};
|
|
1626
|
-
Object.defineProperty(
|
|
1809
|
+
Object.defineProperty(ManagerDepositReceiptV2, "r", {
|
|
1627
1810
|
get: function () {
|
|
1628
|
-
return
|
|
1811
|
+
return ManagerDepositReceiptV2.reified();
|
|
1629
1812
|
},
|
|
1630
1813
|
enumerable: false,
|
|
1631
1814
|
configurable: true
|
|
1632
1815
|
});
|
|
1633
|
-
|
|
1634
|
-
return (0, reified_1.phantom)(
|
|
1816
|
+
ManagerDepositReceiptV2.phantom = function () {
|
|
1817
|
+
return (0, reified_1.phantom)(ManagerDepositReceiptV2.reified());
|
|
1635
1818
|
};
|
|
1636
|
-
Object.defineProperty(
|
|
1819
|
+
Object.defineProperty(ManagerDepositReceiptV2, "p", {
|
|
1637
1820
|
get: function () {
|
|
1638
|
-
return
|
|
1821
|
+
return ManagerDepositReceiptV2.phantom();
|
|
1639
1822
|
},
|
|
1640
1823
|
enumerable: false,
|
|
1641
1824
|
configurable: true
|
|
1642
1825
|
});
|
|
1643
|
-
Object.defineProperty(
|
|
1826
|
+
Object.defineProperty(ManagerDepositReceiptV2, "bcs", {
|
|
1644
1827
|
get: function () {
|
|
1645
|
-
return bcs_1.bcs.struct("
|
|
1828
|
+
return bcs_1.bcs.struct("ManagerDepositReceiptV2", {
|
|
1829
|
+
id: structs_3.UID.bcs,
|
|
1646
1830
|
index: bcs_1.bcs.u64(),
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
price_decimal: bcs_1.bcs.u64(),
|
|
1650
|
-
repaid_amount: bcs_1.bcs.u64(),
|
|
1651
|
-
repaid_usd: bcs_1.bcs.u64(),
|
|
1831
|
+
token_type: structs_1.TypeName.bcs,
|
|
1832
|
+
amount: bcs_1.bcs.u64(),
|
|
1652
1833
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
1653
1834
|
});
|
|
1654
1835
|
},
|
|
1655
1836
|
enumerable: false,
|
|
1656
1837
|
configurable: true
|
|
1657
1838
|
});
|
|
1658
|
-
|
|
1659
|
-
return
|
|
1839
|
+
ManagerDepositReceiptV2.fromFields = function (fields) {
|
|
1840
|
+
return ManagerDepositReceiptV2.reified().new({
|
|
1841
|
+
id: (0, reified_1.decodeFromFields)(structs_3.UID.reified(), fields.id),
|
|
1660
1842
|
index: (0, reified_1.decodeFromFields)("u64", fields.index),
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
priceDecimal: (0, reified_1.decodeFromFields)("u64", fields.price_decimal),
|
|
1664
|
-
repaidAmount: (0, reified_1.decodeFromFields)("u64", fields.repaid_amount),
|
|
1665
|
-
repaidUsd: (0, reified_1.decodeFromFields)("u64", fields.repaid_usd),
|
|
1843
|
+
tokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.token_type),
|
|
1844
|
+
amount: (0, reified_1.decodeFromFields)("u64", fields.amount),
|
|
1666
1845
|
u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
|
|
1667
1846
|
});
|
|
1668
1847
|
};
|
|
1669
|
-
|
|
1670
|
-
if (!
|
|
1671
|
-
throw new Error("not a
|
|
1848
|
+
ManagerDepositReceiptV2.fromFieldsWithTypes = function (item) {
|
|
1849
|
+
if (!isManagerDepositReceiptV2(item.type)) {
|
|
1850
|
+
throw new Error("not a ManagerDepositReceiptV2 type");
|
|
1672
1851
|
}
|
|
1673
|
-
return
|
|
1852
|
+
return ManagerDepositReceiptV2.reified().new({
|
|
1853
|
+
id: (0, reified_1.decodeFromFieldsWithTypes)(structs_3.UID.reified(), item.fields.id),
|
|
1674
1854
|
index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
priceDecimal: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.price_decimal),
|
|
1678
|
-
repaidAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.repaid_amount),
|
|
1679
|
-
repaidUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.repaid_usd),
|
|
1855
|
+
tokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.token_type),
|
|
1856
|
+
amount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.amount),
|
|
1680
1857
|
u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
|
|
1681
1858
|
});
|
|
1682
1859
|
};
|
|
1683
|
-
|
|
1684
|
-
return
|
|
1860
|
+
ManagerDepositReceiptV2.fromBcs = function (data) {
|
|
1861
|
+
return ManagerDepositReceiptV2.fromFields(ManagerDepositReceiptV2.bcs.parse(data));
|
|
1685
1862
|
};
|
|
1686
|
-
|
|
1863
|
+
ManagerDepositReceiptV2.prototype.toJSONField = function () {
|
|
1687
1864
|
return {
|
|
1865
|
+
id: this.id,
|
|
1688
1866
|
index: this.index.toString(),
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
priceDecimal: this.priceDecimal.toString(),
|
|
1692
|
-
repaidAmount: this.repaidAmount.toString(),
|
|
1693
|
-
repaidUsd: this.repaidUsd.toString(),
|
|
1867
|
+
tokenType: this.tokenType.toJSONField(),
|
|
1868
|
+
amount: this.amount.toString(),
|
|
1694
1869
|
u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
|
|
1695
1870
|
};
|
|
1696
1871
|
};
|
|
1697
|
-
|
|
1872
|
+
ManagerDepositReceiptV2.prototype.toJSON = function () {
|
|
1698
1873
|
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
1699
1874
|
};
|
|
1700
|
-
|
|
1701
|
-
return
|
|
1875
|
+
ManagerDepositReceiptV2.fromJSONField = function (field) {
|
|
1876
|
+
return ManagerDepositReceiptV2.reified().new({
|
|
1877
|
+
id: (0, reified_1.decodeFromJSONField)(structs_3.UID.reified(), field.id),
|
|
1702
1878
|
index: (0, reified_1.decodeFromJSONField)("u64", field.index),
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
priceDecimal: (0, reified_1.decodeFromJSONField)("u64", field.priceDecimal),
|
|
1706
|
-
repaidAmount: (0, reified_1.decodeFromJSONField)("u64", field.repaidAmount),
|
|
1707
|
-
repaidUsd: (0, reified_1.decodeFromJSONField)("u64", field.repaidUsd),
|
|
1879
|
+
tokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.tokenType),
|
|
1880
|
+
amount: (0, reified_1.decodeFromJSONField)("u64", field.amount),
|
|
1708
1881
|
u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
|
|
1709
1882
|
});
|
|
1710
1883
|
};
|
|
1711
|
-
|
|
1712
|
-
if (json.$typeName !==
|
|
1884
|
+
ManagerDepositReceiptV2.fromJSON = function (json) {
|
|
1885
|
+
if (json.$typeName !== ManagerDepositReceiptV2.$typeName) {
|
|
1713
1886
|
throw new Error("not a WithTwoGenerics json object");
|
|
1714
1887
|
}
|
|
1715
|
-
return
|
|
1888
|
+
return ManagerDepositReceiptV2.fromJSONField(json);
|
|
1716
1889
|
};
|
|
1717
|
-
|
|
1890
|
+
ManagerDepositReceiptV2.fromSuiParsedData = function (content) {
|
|
1718
1891
|
if (content.dataType !== "moveObject") {
|
|
1719
1892
|
throw new Error("not an object");
|
|
1720
1893
|
}
|
|
1721
|
-
if (!
|
|
1722
|
-
throw new Error("object at ".concat(content.fields.id, " is not a
|
|
1894
|
+
if (!isManagerDepositReceiptV2(content.type)) {
|
|
1895
|
+
throw new Error("object at ".concat(content.fields.id, " is not a ManagerDepositReceiptV2 object"));
|
|
1723
1896
|
}
|
|
1724
|
-
return
|
|
1897
|
+
return ManagerDepositReceiptV2.fromFieldsWithTypes(content);
|
|
1725
1898
|
};
|
|
1726
|
-
|
|
1899
|
+
ManagerDepositReceiptV2.fromSuiObjectData = function (data) {
|
|
1727
1900
|
if (data.bcs) {
|
|
1728
|
-
if (data.bcs.dataType !== "moveObject" || !
|
|
1729
|
-
throw new Error("object at is not a
|
|
1901
|
+
if (data.bcs.dataType !== "moveObject" || !isManagerDepositReceiptV2(data.bcs.type)) {
|
|
1902
|
+
throw new Error("object at is not a ManagerDepositReceiptV2 object");
|
|
1730
1903
|
}
|
|
1731
|
-
return
|
|
1904
|
+
return ManagerDepositReceiptV2.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
1732
1905
|
}
|
|
1733
1906
|
if (data.content) {
|
|
1734
|
-
return
|
|
1907
|
+
return ManagerDepositReceiptV2.fromSuiParsedData(data.content);
|
|
1735
1908
|
}
|
|
1736
1909
|
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
1737
1910
|
};
|
|
1738
|
-
|
|
1911
|
+
ManagerDepositReceiptV2.fetch = function (client, id) {
|
|
1739
1912
|
return __awaiter(this, void 0, void 0, function () {
|
|
1740
1913
|
var res;
|
|
1741
1914
|
var _a, _b;
|
|
@@ -1745,186 +1918,168 @@ var ManagerFlashRepayLiquidityEvent = /** @class */ (function () {
|
|
|
1745
1918
|
case 1:
|
|
1746
1919
|
res = _c.sent();
|
|
1747
1920
|
if (res.error) {
|
|
1748
|
-
throw new Error("error fetching
|
|
1921
|
+
throw new Error("error fetching ManagerDepositReceiptV2 object at id ".concat(id, ": ").concat(res.error.code));
|
|
1749
1922
|
}
|
|
1750
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !
|
|
1751
|
-
throw new Error("object at id ".concat(id, " is not a
|
|
1923
|
+
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isManagerDepositReceiptV2(res.data.bcs.type)) {
|
|
1924
|
+
throw new Error("object at id ".concat(id, " is not a ManagerDepositReceiptV2 object"));
|
|
1752
1925
|
}
|
|
1753
|
-
return [2 /*return*/,
|
|
1926
|
+
return [2 /*return*/, ManagerDepositReceiptV2.fromSuiObjectData(res.data)];
|
|
1754
1927
|
}
|
|
1755
1928
|
});
|
|
1756
1929
|
});
|
|
1757
1930
|
};
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
return
|
|
1931
|
+
ManagerDepositReceiptV2.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::ManagerDepositReceiptV2");
|
|
1932
|
+
ManagerDepositReceiptV2.$numTypeParams = 0;
|
|
1933
|
+
ManagerDepositReceiptV2.$isPhantom = [];
|
|
1934
|
+
return ManagerDepositReceiptV2;
|
|
1762
1935
|
}());
|
|
1763
|
-
exports.
|
|
1764
|
-
/* ==============================
|
|
1765
|
-
function
|
|
1936
|
+
exports.ManagerDepositReceiptV2 = ManagerDepositReceiptV2;
|
|
1937
|
+
/* ============================== ManagerEmergencyDepositEvent =============================== */
|
|
1938
|
+
function isManagerEmergencyDepositEvent(type) {
|
|
1766
1939
|
type = (0, util_1.compressSuiType)(type);
|
|
1767
|
-
return type === "".concat(index_1.PKG_V1, "::lp_pool::
|
|
1940
|
+
return type === "".concat(index_1.PKG_V1, "::lp_pool::ManagerEmergencyDepositEvent");
|
|
1768
1941
|
}
|
|
1769
|
-
var
|
|
1770
|
-
function
|
|
1942
|
+
var ManagerEmergencyDepositEvent = /** @class */ (function () {
|
|
1943
|
+
function ManagerEmergencyDepositEvent(typeArgs, fields) {
|
|
1771
1944
|
this.__StructClass = true;
|
|
1772
|
-
this.$typeName =
|
|
1773
|
-
this.$isPhantom =
|
|
1774
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([
|
|
1945
|
+
this.$typeName = ManagerEmergencyDepositEvent.$typeName;
|
|
1946
|
+
this.$isPhantom = ManagerEmergencyDepositEvent.$isPhantom;
|
|
1947
|
+
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([ManagerEmergencyDepositEvent.$typeName], __read(typeArgs), false));
|
|
1775
1948
|
this.$typeArgs = typeArgs;
|
|
1776
|
-
this.
|
|
1777
|
-
this.
|
|
1778
|
-
this.
|
|
1779
|
-
this.
|
|
1780
|
-
this.utilizationThresholdBp1 = fields.utilizationThresholdBp1;
|
|
1781
|
-
this.borrowIntervalTsMs = fields.borrowIntervalTsMs;
|
|
1782
|
-
this.maxOrderReserveRatioBp = fields.maxOrderReserveRatioBp;
|
|
1949
|
+
this.sender = fields.sender;
|
|
1950
|
+
this.index = fields.index;
|
|
1951
|
+
this.liquidityTokenType = fields.liquidityTokenType;
|
|
1952
|
+
this.amount = fields.amount;
|
|
1783
1953
|
this.u64Padding = fields.u64Padding;
|
|
1784
1954
|
}
|
|
1785
|
-
|
|
1955
|
+
ManagerEmergencyDepositEvent.reified = function () {
|
|
1786
1956
|
var _this = this;
|
|
1787
1957
|
return {
|
|
1788
|
-
typeName:
|
|
1789
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([
|
|
1958
|
+
typeName: ManagerEmergencyDepositEvent.$typeName,
|
|
1959
|
+
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([ManagerEmergencyDepositEvent.$typeName], [], false)),
|
|
1790
1960
|
typeArgs: [],
|
|
1791
|
-
isPhantom:
|
|
1961
|
+
isPhantom: ManagerEmergencyDepositEvent.$isPhantom,
|
|
1792
1962
|
reifiedTypeArgs: [],
|
|
1793
|
-
fromFields: function (fields) { return
|
|
1794
|
-
fromFieldsWithTypes: function (item) { return
|
|
1795
|
-
fromBcs: function (data) { return
|
|
1796
|
-
bcs:
|
|
1797
|
-
fromJSONField: function (field) { return
|
|
1798
|
-
fromJSON: function (json) { return
|
|
1799
|
-
fromSuiParsedData: function (content) { return
|
|
1800
|
-
fromSuiObjectData: function (content) { return
|
|
1963
|
+
fromFields: function (fields) { return ManagerEmergencyDepositEvent.fromFields(fields); },
|
|
1964
|
+
fromFieldsWithTypes: function (item) { return ManagerEmergencyDepositEvent.fromFieldsWithTypes(item); },
|
|
1965
|
+
fromBcs: function (data) { return ManagerEmergencyDepositEvent.fromBcs(data); },
|
|
1966
|
+
bcs: ManagerEmergencyDepositEvent.bcs,
|
|
1967
|
+
fromJSONField: function (field) { return ManagerEmergencyDepositEvent.fromJSONField(field); },
|
|
1968
|
+
fromJSON: function (json) { return ManagerEmergencyDepositEvent.fromJSON(json); },
|
|
1969
|
+
fromSuiParsedData: function (content) { return ManagerEmergencyDepositEvent.fromSuiParsedData(content); },
|
|
1970
|
+
fromSuiObjectData: function (content) { return ManagerEmergencyDepositEvent.fromSuiObjectData(content); },
|
|
1801
1971
|
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
1802
|
-
return [2 /*return*/,
|
|
1972
|
+
return [2 /*return*/, ManagerEmergencyDepositEvent.fetch(client, id)];
|
|
1803
1973
|
}); }); },
|
|
1804
1974
|
new: function (fields) {
|
|
1805
|
-
return new
|
|
1975
|
+
return new ManagerEmergencyDepositEvent([], fields);
|
|
1806
1976
|
},
|
|
1807
1977
|
kind: "StructClassReified",
|
|
1808
1978
|
};
|
|
1809
1979
|
};
|
|
1810
|
-
Object.defineProperty(
|
|
1980
|
+
Object.defineProperty(ManagerEmergencyDepositEvent, "r", {
|
|
1811
1981
|
get: function () {
|
|
1812
|
-
return
|
|
1982
|
+
return ManagerEmergencyDepositEvent.reified();
|
|
1813
1983
|
},
|
|
1814
1984
|
enumerable: false,
|
|
1815
1985
|
configurable: true
|
|
1816
1986
|
});
|
|
1817
|
-
|
|
1818
|
-
return (0, reified_1.phantom)(
|
|
1987
|
+
ManagerEmergencyDepositEvent.phantom = function () {
|
|
1988
|
+
return (0, reified_1.phantom)(ManagerEmergencyDepositEvent.reified());
|
|
1819
1989
|
};
|
|
1820
|
-
Object.defineProperty(
|
|
1990
|
+
Object.defineProperty(ManagerEmergencyDepositEvent, "p", {
|
|
1821
1991
|
get: function () {
|
|
1822
|
-
return
|
|
1992
|
+
return ManagerEmergencyDepositEvent.phantom();
|
|
1823
1993
|
},
|
|
1824
1994
|
enumerable: false,
|
|
1825
1995
|
configurable: true
|
|
1826
1996
|
});
|
|
1827
|
-
Object.defineProperty(
|
|
1997
|
+
Object.defineProperty(ManagerEmergencyDepositEvent, "bcs", {
|
|
1828
1998
|
get: function () {
|
|
1829
|
-
return bcs_1.bcs.struct("
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
utilization_threshold_bp_1: bcs_1.bcs.u64(),
|
|
1835
|
-
borrow_interval_ts_ms: bcs_1.bcs.u64(),
|
|
1836
|
-
max_order_reserve_ratio_bp: bcs_1.bcs.u64(),
|
|
1999
|
+
return bcs_1.bcs.struct("ManagerEmergencyDepositEvent", {
|
|
2000
|
+
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); } }),
|
|
2001
|
+
index: bcs_1.bcs.u64(),
|
|
2002
|
+
liquidity_token_type: structs_1.TypeName.bcs,
|
|
2003
|
+
amount: bcs_1.bcs.u64(),
|
|
1837
2004
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
1838
2005
|
});
|
|
1839
2006
|
},
|
|
1840
2007
|
enumerable: false,
|
|
1841
2008
|
configurable: true
|
|
1842
2009
|
});
|
|
1843
|
-
|
|
1844
|
-
return
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
utilizationThresholdBp1: (0, reified_1.decodeFromFields)("u64", fields.utilization_threshold_bp_1),
|
|
1850
|
-
borrowIntervalTsMs: (0, reified_1.decodeFromFields)("u64", fields.borrow_interval_ts_ms),
|
|
1851
|
-
maxOrderReserveRatioBp: (0, reified_1.decodeFromFields)("u64", fields.max_order_reserve_ratio_bp),
|
|
2010
|
+
ManagerEmergencyDepositEvent.fromFields = function (fields) {
|
|
2011
|
+
return ManagerEmergencyDepositEvent.reified().new({
|
|
2012
|
+
sender: (0, reified_1.decodeFromFields)("address", fields.sender),
|
|
2013
|
+
index: (0, reified_1.decodeFromFields)("u64", fields.index),
|
|
2014
|
+
liquidityTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.liquidity_token_type),
|
|
2015
|
+
amount: (0, reified_1.decodeFromFields)("u64", fields.amount),
|
|
1852
2016
|
u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
|
|
1853
2017
|
});
|
|
1854
2018
|
};
|
|
1855
|
-
|
|
1856
|
-
if (!
|
|
1857
|
-
throw new Error("not a
|
|
2019
|
+
ManagerEmergencyDepositEvent.fromFieldsWithTypes = function (item) {
|
|
2020
|
+
if (!isManagerEmergencyDepositEvent(item.type)) {
|
|
2021
|
+
throw new Error("not a ManagerEmergencyDepositEvent type");
|
|
1858
2022
|
}
|
|
1859
|
-
return
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
utilizationThresholdBp1: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.utilization_threshold_bp_1),
|
|
1865
|
-
borrowIntervalTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.borrow_interval_ts_ms),
|
|
1866
|
-
maxOrderReserveRatioBp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.max_order_reserve_ratio_bp),
|
|
2023
|
+
return ManagerEmergencyDepositEvent.reified().new({
|
|
2024
|
+
sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
|
|
2025
|
+
index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
|
|
2026
|
+
liquidityTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.liquidity_token_type),
|
|
2027
|
+
amount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.amount),
|
|
1867
2028
|
u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
|
|
1868
2029
|
});
|
|
1869
2030
|
};
|
|
1870
|
-
|
|
1871
|
-
return
|
|
2031
|
+
ManagerEmergencyDepositEvent.fromBcs = function (data) {
|
|
2032
|
+
return ManagerEmergencyDepositEvent.fromFields(ManagerEmergencyDepositEvent.bcs.parse(data));
|
|
1872
2033
|
};
|
|
1873
|
-
|
|
2034
|
+
ManagerEmergencyDepositEvent.prototype.toJSONField = function () {
|
|
1874
2035
|
return {
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
utilizationThresholdBp1: this.utilizationThresholdBp1.toString(),
|
|
1880
|
-
borrowIntervalTsMs: this.borrowIntervalTsMs.toString(),
|
|
1881
|
-
maxOrderReserveRatioBp: this.maxOrderReserveRatioBp.toString(),
|
|
2036
|
+
sender: this.sender,
|
|
2037
|
+
index: this.index.toString(),
|
|
2038
|
+
liquidityTokenType: this.liquidityTokenType.toJSONField(),
|
|
2039
|
+
amount: this.amount.toString(),
|
|
1882
2040
|
u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
|
|
1883
2041
|
};
|
|
1884
2042
|
};
|
|
1885
|
-
|
|
2043
|
+
ManagerEmergencyDepositEvent.prototype.toJSON = function () {
|
|
1886
2044
|
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
1887
2045
|
};
|
|
1888
|
-
|
|
1889
|
-
return
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
utilizationThresholdBp1: (0, reified_1.decodeFromJSONField)("u64", field.utilizationThresholdBp1),
|
|
1895
|
-
borrowIntervalTsMs: (0, reified_1.decodeFromJSONField)("u64", field.borrowIntervalTsMs),
|
|
1896
|
-
maxOrderReserveRatioBp: (0, reified_1.decodeFromJSONField)("u64", field.maxOrderReserveRatioBp),
|
|
2046
|
+
ManagerEmergencyDepositEvent.fromJSONField = function (field) {
|
|
2047
|
+
return ManagerEmergencyDepositEvent.reified().new({
|
|
2048
|
+
sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
|
|
2049
|
+
index: (0, reified_1.decodeFromJSONField)("u64", field.index),
|
|
2050
|
+
liquidityTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.liquidityTokenType),
|
|
2051
|
+
amount: (0, reified_1.decodeFromJSONField)("u64", field.amount),
|
|
1897
2052
|
u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
|
|
1898
2053
|
});
|
|
1899
2054
|
};
|
|
1900
|
-
|
|
1901
|
-
if (json.$typeName !==
|
|
2055
|
+
ManagerEmergencyDepositEvent.fromJSON = function (json) {
|
|
2056
|
+
if (json.$typeName !== ManagerEmergencyDepositEvent.$typeName) {
|
|
1902
2057
|
throw new Error("not a WithTwoGenerics json object");
|
|
1903
2058
|
}
|
|
1904
|
-
return
|
|
2059
|
+
return ManagerEmergencyDepositEvent.fromJSONField(json);
|
|
1905
2060
|
};
|
|
1906
|
-
|
|
2061
|
+
ManagerEmergencyDepositEvent.fromSuiParsedData = function (content) {
|
|
1907
2062
|
if (content.dataType !== "moveObject") {
|
|
1908
2063
|
throw new Error("not an object");
|
|
1909
2064
|
}
|
|
1910
|
-
if (!
|
|
1911
|
-
throw new Error("object at ".concat(content.fields.id, " is not a
|
|
2065
|
+
if (!isManagerEmergencyDepositEvent(content.type)) {
|
|
2066
|
+
throw new Error("object at ".concat(content.fields.id, " is not a ManagerEmergencyDepositEvent object"));
|
|
1912
2067
|
}
|
|
1913
|
-
return
|
|
2068
|
+
return ManagerEmergencyDepositEvent.fromFieldsWithTypes(content);
|
|
1914
2069
|
};
|
|
1915
|
-
|
|
2070
|
+
ManagerEmergencyDepositEvent.fromSuiObjectData = function (data) {
|
|
1916
2071
|
if (data.bcs) {
|
|
1917
|
-
if (data.bcs.dataType !== "moveObject" || !
|
|
1918
|
-
throw new Error("object at is not a
|
|
2072
|
+
if (data.bcs.dataType !== "moveObject" || !isManagerEmergencyDepositEvent(data.bcs.type)) {
|
|
2073
|
+
throw new Error("object at is not a ManagerEmergencyDepositEvent object");
|
|
1919
2074
|
}
|
|
1920
|
-
return
|
|
2075
|
+
return ManagerEmergencyDepositEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
1921
2076
|
}
|
|
1922
2077
|
if (data.content) {
|
|
1923
|
-
return
|
|
2078
|
+
return ManagerEmergencyDepositEvent.fromSuiParsedData(data.content);
|
|
1924
2079
|
}
|
|
1925
2080
|
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
1926
2081
|
};
|
|
1927
|
-
|
|
2082
|
+
ManagerEmergencyDepositEvent.fetch = function (client, id) {
|
|
1928
2083
|
return __awaiter(this, void 0, void 0, function () {
|
|
1929
2084
|
var res;
|
|
1930
2085
|
var _a, _b;
|
|
@@ -1934,192 +2089,1296 @@ var MarginConfig = /** @class */ (function () {
|
|
|
1934
2089
|
case 1:
|
|
1935
2090
|
res = _c.sent();
|
|
1936
2091
|
if (res.error) {
|
|
1937
|
-
throw new Error("error fetching
|
|
2092
|
+
throw new Error("error fetching ManagerEmergencyDepositEvent object at id ".concat(id, ": ").concat(res.error.code));
|
|
1938
2093
|
}
|
|
1939
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !
|
|
1940
|
-
throw new Error("object at id ".concat(id, " is not a
|
|
2094
|
+
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isManagerEmergencyDepositEvent(res.data.bcs.type)) {
|
|
2095
|
+
throw new Error("object at id ".concat(id, " is not a ManagerEmergencyDepositEvent object"));
|
|
1941
2096
|
}
|
|
1942
|
-
return [2 /*return*/,
|
|
2097
|
+
return [2 /*return*/, ManagerEmergencyDepositEvent.fromSuiObjectData(res.data)];
|
|
1943
2098
|
}
|
|
1944
2099
|
});
|
|
1945
2100
|
});
|
|
1946
2101
|
};
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
return
|
|
2102
|
+
ManagerEmergencyDepositEvent.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::ManagerEmergencyDepositEvent");
|
|
2103
|
+
ManagerEmergencyDepositEvent.$numTypeParams = 0;
|
|
2104
|
+
ManagerEmergencyDepositEvent.$isPhantom = [];
|
|
2105
|
+
return ManagerEmergencyDepositEvent;
|
|
1951
2106
|
}());
|
|
1952
|
-
exports.
|
|
1953
|
-
/* ==============================
|
|
1954
|
-
function
|
|
2107
|
+
exports.ManagerEmergencyDepositEvent = ManagerEmergencyDepositEvent;
|
|
2108
|
+
/* ============================== ManagerEmergencyWithdrawEvent =============================== */
|
|
2109
|
+
function isManagerEmergencyWithdrawEvent(type) {
|
|
1955
2110
|
type = (0, util_1.compressSuiType)(type);
|
|
1956
|
-
return type === "".concat(index_1.PKG_V1, "::lp_pool::
|
|
2111
|
+
return type === "".concat(index_1.PKG_V1, "::lp_pool::ManagerEmergencyWithdrawEvent");
|
|
1957
2112
|
}
|
|
1958
|
-
var
|
|
1959
|
-
function
|
|
2113
|
+
var ManagerEmergencyWithdrawEvent = /** @class */ (function () {
|
|
2114
|
+
function ManagerEmergencyWithdrawEvent(typeArgs, fields) {
|
|
1960
2115
|
this.__StructClass = true;
|
|
1961
|
-
this.$typeName =
|
|
1962
|
-
this.$isPhantom =
|
|
1963
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([
|
|
2116
|
+
this.$typeName = ManagerEmergencyWithdrawEvent.$typeName;
|
|
2117
|
+
this.$isPhantom = ManagerEmergencyWithdrawEvent.$isPhantom;
|
|
2118
|
+
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([ManagerEmergencyWithdrawEvent.$typeName], __read(typeArgs), false));
|
|
1964
2119
|
this.$typeArgs = typeArgs;
|
|
1965
2120
|
this.sender = fields.sender;
|
|
1966
2121
|
this.index = fields.index;
|
|
1967
2122
|
this.liquidityTokenType = fields.liquidityTokenType;
|
|
1968
|
-
this.
|
|
1969
|
-
this.depositAmountUsd = fields.depositAmountUsd;
|
|
1970
|
-
this.mintFeeUsd = fields.mintFeeUsd;
|
|
1971
|
-
this.lpTokenType = fields.lpTokenType;
|
|
1972
|
-
this.mintedLpAmount = fields.mintedLpAmount;
|
|
2123
|
+
this.amount = fields.amount;
|
|
1973
2124
|
this.u64Padding = fields.u64Padding;
|
|
1974
2125
|
}
|
|
1975
|
-
|
|
2126
|
+
ManagerEmergencyWithdrawEvent.reified = function () {
|
|
1976
2127
|
var _this = this;
|
|
1977
2128
|
return {
|
|
1978
|
-
typeName:
|
|
1979
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([
|
|
2129
|
+
typeName: ManagerEmergencyWithdrawEvent.$typeName,
|
|
2130
|
+
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([ManagerEmergencyWithdrawEvent.$typeName], [], false)),
|
|
1980
2131
|
typeArgs: [],
|
|
1981
|
-
isPhantom:
|
|
2132
|
+
isPhantom: ManagerEmergencyWithdrawEvent.$isPhantom,
|
|
1982
2133
|
reifiedTypeArgs: [],
|
|
1983
|
-
fromFields: function (fields) { return
|
|
1984
|
-
fromFieldsWithTypes: function (item) { return
|
|
1985
|
-
fromBcs: function (data) { return
|
|
1986
|
-
bcs:
|
|
1987
|
-
fromJSONField: function (field) { return
|
|
1988
|
-
fromJSON: function (json) { return
|
|
1989
|
-
fromSuiParsedData: function (content) { return
|
|
1990
|
-
fromSuiObjectData: function (content) { return
|
|
2134
|
+
fromFields: function (fields) { return ManagerEmergencyWithdrawEvent.fromFields(fields); },
|
|
2135
|
+
fromFieldsWithTypes: function (item) { return ManagerEmergencyWithdrawEvent.fromFieldsWithTypes(item); },
|
|
2136
|
+
fromBcs: function (data) { return ManagerEmergencyWithdrawEvent.fromBcs(data); },
|
|
2137
|
+
bcs: ManagerEmergencyWithdrawEvent.bcs,
|
|
2138
|
+
fromJSONField: function (field) { return ManagerEmergencyWithdrawEvent.fromJSONField(field); },
|
|
2139
|
+
fromJSON: function (json) { return ManagerEmergencyWithdrawEvent.fromJSON(json); },
|
|
2140
|
+
fromSuiParsedData: function (content) { return ManagerEmergencyWithdrawEvent.fromSuiParsedData(content); },
|
|
2141
|
+
fromSuiObjectData: function (content) { return ManagerEmergencyWithdrawEvent.fromSuiObjectData(content); },
|
|
1991
2142
|
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
1992
|
-
return [2 /*return*/,
|
|
2143
|
+
return [2 /*return*/, ManagerEmergencyWithdrawEvent.fetch(client, id)];
|
|
1993
2144
|
}); }); },
|
|
1994
2145
|
new: function (fields) {
|
|
1995
|
-
return new
|
|
2146
|
+
return new ManagerEmergencyWithdrawEvent([], fields);
|
|
1996
2147
|
},
|
|
1997
2148
|
kind: "StructClassReified",
|
|
1998
2149
|
};
|
|
1999
2150
|
};
|
|
2000
|
-
Object.defineProperty(
|
|
2151
|
+
Object.defineProperty(ManagerEmergencyWithdrawEvent, "r", {
|
|
2001
2152
|
get: function () {
|
|
2002
|
-
return
|
|
2153
|
+
return ManagerEmergencyWithdrawEvent.reified();
|
|
2003
2154
|
},
|
|
2004
2155
|
enumerable: false,
|
|
2005
2156
|
configurable: true
|
|
2006
2157
|
});
|
|
2007
|
-
|
|
2008
|
-
return (0, reified_1.phantom)(
|
|
2158
|
+
ManagerEmergencyWithdrawEvent.phantom = function () {
|
|
2159
|
+
return (0, reified_1.phantom)(ManagerEmergencyWithdrawEvent.reified());
|
|
2009
2160
|
};
|
|
2010
|
-
Object.defineProperty(
|
|
2161
|
+
Object.defineProperty(ManagerEmergencyWithdrawEvent, "p", {
|
|
2011
2162
|
get: function () {
|
|
2012
|
-
return
|
|
2163
|
+
return ManagerEmergencyWithdrawEvent.phantom();
|
|
2013
2164
|
},
|
|
2014
2165
|
enumerable: false,
|
|
2015
2166
|
configurable: true
|
|
2016
2167
|
});
|
|
2017
|
-
Object.defineProperty(
|
|
2168
|
+
Object.defineProperty(ManagerEmergencyWithdrawEvent, "bcs", {
|
|
2018
2169
|
get: function () {
|
|
2019
|
-
return bcs_1.bcs.struct("
|
|
2170
|
+
return bcs_1.bcs.struct("ManagerEmergencyWithdrawEvent", {
|
|
2020
2171
|
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); } }),
|
|
2021
2172
|
index: bcs_1.bcs.u64(),
|
|
2022
|
-
liquidity_token_type: structs_1.TypeName.bcs,
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2173
|
+
liquidity_token_type: structs_1.TypeName.bcs,
|
|
2174
|
+
amount: bcs_1.bcs.u64(),
|
|
2175
|
+
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
2176
|
+
});
|
|
2177
|
+
},
|
|
2178
|
+
enumerable: false,
|
|
2179
|
+
configurable: true
|
|
2180
|
+
});
|
|
2181
|
+
ManagerEmergencyWithdrawEvent.fromFields = function (fields) {
|
|
2182
|
+
return ManagerEmergencyWithdrawEvent.reified().new({
|
|
2183
|
+
sender: (0, reified_1.decodeFromFields)("address", fields.sender),
|
|
2184
|
+
index: (0, reified_1.decodeFromFields)("u64", fields.index),
|
|
2185
|
+
liquidityTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.liquidity_token_type),
|
|
2186
|
+
amount: (0, reified_1.decodeFromFields)("u64", fields.amount),
|
|
2187
|
+
u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
|
|
2188
|
+
});
|
|
2189
|
+
};
|
|
2190
|
+
ManagerEmergencyWithdrawEvent.fromFieldsWithTypes = function (item) {
|
|
2191
|
+
if (!isManagerEmergencyWithdrawEvent(item.type)) {
|
|
2192
|
+
throw new Error("not a ManagerEmergencyWithdrawEvent type");
|
|
2193
|
+
}
|
|
2194
|
+
return ManagerEmergencyWithdrawEvent.reified().new({
|
|
2195
|
+
sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
|
|
2196
|
+
index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
|
|
2197
|
+
liquidityTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.liquidity_token_type),
|
|
2198
|
+
amount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.amount),
|
|
2199
|
+
u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
|
|
2200
|
+
});
|
|
2201
|
+
};
|
|
2202
|
+
ManagerEmergencyWithdrawEvent.fromBcs = function (data) {
|
|
2203
|
+
return ManagerEmergencyWithdrawEvent.fromFields(ManagerEmergencyWithdrawEvent.bcs.parse(data));
|
|
2204
|
+
};
|
|
2205
|
+
ManagerEmergencyWithdrawEvent.prototype.toJSONField = function () {
|
|
2206
|
+
return {
|
|
2207
|
+
sender: this.sender,
|
|
2208
|
+
index: this.index.toString(),
|
|
2209
|
+
liquidityTokenType: this.liquidityTokenType.toJSONField(),
|
|
2210
|
+
amount: this.amount.toString(),
|
|
2211
|
+
u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
|
|
2212
|
+
};
|
|
2213
|
+
};
|
|
2214
|
+
ManagerEmergencyWithdrawEvent.prototype.toJSON = function () {
|
|
2215
|
+
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
2216
|
+
};
|
|
2217
|
+
ManagerEmergencyWithdrawEvent.fromJSONField = function (field) {
|
|
2218
|
+
return ManagerEmergencyWithdrawEvent.reified().new({
|
|
2219
|
+
sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
|
|
2220
|
+
index: (0, reified_1.decodeFromJSONField)("u64", field.index),
|
|
2221
|
+
liquidityTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.liquidityTokenType),
|
|
2222
|
+
amount: (0, reified_1.decodeFromJSONField)("u64", field.amount),
|
|
2223
|
+
u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
|
|
2224
|
+
});
|
|
2225
|
+
};
|
|
2226
|
+
ManagerEmergencyWithdrawEvent.fromJSON = function (json) {
|
|
2227
|
+
if (json.$typeName !== ManagerEmergencyWithdrawEvent.$typeName) {
|
|
2228
|
+
throw new Error("not a WithTwoGenerics json object");
|
|
2229
|
+
}
|
|
2230
|
+
return ManagerEmergencyWithdrawEvent.fromJSONField(json);
|
|
2231
|
+
};
|
|
2232
|
+
ManagerEmergencyWithdrawEvent.fromSuiParsedData = function (content) {
|
|
2233
|
+
if (content.dataType !== "moveObject") {
|
|
2234
|
+
throw new Error("not an object");
|
|
2235
|
+
}
|
|
2236
|
+
if (!isManagerEmergencyWithdrawEvent(content.type)) {
|
|
2237
|
+
throw new Error("object at ".concat(content.fields.id, " is not a ManagerEmergencyWithdrawEvent object"));
|
|
2238
|
+
}
|
|
2239
|
+
return ManagerEmergencyWithdrawEvent.fromFieldsWithTypes(content);
|
|
2240
|
+
};
|
|
2241
|
+
ManagerEmergencyWithdrawEvent.fromSuiObjectData = function (data) {
|
|
2242
|
+
if (data.bcs) {
|
|
2243
|
+
if (data.bcs.dataType !== "moveObject" || !isManagerEmergencyWithdrawEvent(data.bcs.type)) {
|
|
2244
|
+
throw new Error("object at is not a ManagerEmergencyWithdrawEvent object");
|
|
2245
|
+
}
|
|
2246
|
+
return ManagerEmergencyWithdrawEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
2247
|
+
}
|
|
2248
|
+
if (data.content) {
|
|
2249
|
+
return ManagerEmergencyWithdrawEvent.fromSuiParsedData(data.content);
|
|
2250
|
+
}
|
|
2251
|
+
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
2252
|
+
};
|
|
2253
|
+
ManagerEmergencyWithdrawEvent.fetch = function (client, id) {
|
|
2254
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2255
|
+
var res;
|
|
2256
|
+
var _a, _b;
|
|
2257
|
+
return __generator(this, function (_c) {
|
|
2258
|
+
switch (_c.label) {
|
|
2259
|
+
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
2260
|
+
case 1:
|
|
2261
|
+
res = _c.sent();
|
|
2262
|
+
if (res.error) {
|
|
2263
|
+
throw new Error("error fetching ManagerEmergencyWithdrawEvent object at id ".concat(id, ": ").concat(res.error.code));
|
|
2264
|
+
}
|
|
2265
|
+
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isManagerEmergencyWithdrawEvent(res.data.bcs.type)) {
|
|
2266
|
+
throw new Error("object at id ".concat(id, " is not a ManagerEmergencyWithdrawEvent object"));
|
|
2267
|
+
}
|
|
2268
|
+
return [2 /*return*/, ManagerEmergencyWithdrawEvent.fromSuiObjectData(res.data)];
|
|
2269
|
+
}
|
|
2270
|
+
});
|
|
2271
|
+
});
|
|
2272
|
+
};
|
|
2273
|
+
ManagerEmergencyWithdrawEvent.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::ManagerEmergencyWithdrawEvent");
|
|
2274
|
+
ManagerEmergencyWithdrawEvent.$numTypeParams = 0;
|
|
2275
|
+
ManagerEmergencyWithdrawEvent.$isPhantom = [];
|
|
2276
|
+
return ManagerEmergencyWithdrawEvent;
|
|
2277
|
+
}());
|
|
2278
|
+
exports.ManagerEmergencyWithdrawEvent = ManagerEmergencyWithdrawEvent;
|
|
2279
|
+
/* ============================== ManagerFlashRemoveLiquidityEvent =============================== */
|
|
2280
|
+
function isManagerFlashRemoveLiquidityEvent(type) {
|
|
2281
|
+
type = (0, util_1.compressSuiType)(type);
|
|
2282
|
+
return type === "".concat(index_1.PKG_V1, "::lp_pool::ManagerFlashRemoveLiquidityEvent");
|
|
2283
|
+
}
|
|
2284
|
+
var ManagerFlashRemoveLiquidityEvent = /** @class */ (function () {
|
|
2285
|
+
function ManagerFlashRemoveLiquidityEvent(typeArgs, fields) {
|
|
2286
|
+
this.__StructClass = true;
|
|
2287
|
+
this.$typeName = ManagerFlashRemoveLiquidityEvent.$typeName;
|
|
2288
|
+
this.$isPhantom = ManagerFlashRemoveLiquidityEvent.$isPhantom;
|
|
2289
|
+
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([ManagerFlashRemoveLiquidityEvent.$typeName], __read(typeArgs), false));
|
|
2290
|
+
this.$typeArgs = typeArgs;
|
|
2291
|
+
this.index = fields.index;
|
|
2292
|
+
this.liquidityToken = fields.liquidityToken;
|
|
2293
|
+
this.price = fields.price;
|
|
2294
|
+
this.priceDecimal = fields.priceDecimal;
|
|
2295
|
+
this.removeAmount = fields.removeAmount;
|
|
2296
|
+
this.removedUsd = fields.removedUsd;
|
|
2297
|
+
this.u64Padding = fields.u64Padding;
|
|
2298
|
+
}
|
|
2299
|
+
ManagerFlashRemoveLiquidityEvent.reified = function () {
|
|
2300
|
+
var _this = this;
|
|
2301
|
+
return {
|
|
2302
|
+
typeName: ManagerFlashRemoveLiquidityEvent.$typeName,
|
|
2303
|
+
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([ManagerFlashRemoveLiquidityEvent.$typeName], [], false)),
|
|
2304
|
+
typeArgs: [],
|
|
2305
|
+
isPhantom: ManagerFlashRemoveLiquidityEvent.$isPhantom,
|
|
2306
|
+
reifiedTypeArgs: [],
|
|
2307
|
+
fromFields: function (fields) { return ManagerFlashRemoveLiquidityEvent.fromFields(fields); },
|
|
2308
|
+
fromFieldsWithTypes: function (item) { return ManagerFlashRemoveLiquidityEvent.fromFieldsWithTypes(item); },
|
|
2309
|
+
fromBcs: function (data) { return ManagerFlashRemoveLiquidityEvent.fromBcs(data); },
|
|
2310
|
+
bcs: ManagerFlashRemoveLiquidityEvent.bcs,
|
|
2311
|
+
fromJSONField: function (field) { return ManagerFlashRemoveLiquidityEvent.fromJSONField(field); },
|
|
2312
|
+
fromJSON: function (json) { return ManagerFlashRemoveLiquidityEvent.fromJSON(json); },
|
|
2313
|
+
fromSuiParsedData: function (content) { return ManagerFlashRemoveLiquidityEvent.fromSuiParsedData(content); },
|
|
2314
|
+
fromSuiObjectData: function (content) { return ManagerFlashRemoveLiquidityEvent.fromSuiObjectData(content); },
|
|
2315
|
+
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
2316
|
+
return [2 /*return*/, ManagerFlashRemoveLiquidityEvent.fetch(client, id)];
|
|
2317
|
+
}); }); },
|
|
2318
|
+
new: function (fields) {
|
|
2319
|
+
return new ManagerFlashRemoveLiquidityEvent([], fields);
|
|
2320
|
+
},
|
|
2321
|
+
kind: "StructClassReified",
|
|
2322
|
+
};
|
|
2323
|
+
};
|
|
2324
|
+
Object.defineProperty(ManagerFlashRemoveLiquidityEvent, "r", {
|
|
2325
|
+
get: function () {
|
|
2326
|
+
return ManagerFlashRemoveLiquidityEvent.reified();
|
|
2327
|
+
},
|
|
2328
|
+
enumerable: false,
|
|
2329
|
+
configurable: true
|
|
2330
|
+
});
|
|
2331
|
+
ManagerFlashRemoveLiquidityEvent.phantom = function () {
|
|
2332
|
+
return (0, reified_1.phantom)(ManagerFlashRemoveLiquidityEvent.reified());
|
|
2333
|
+
};
|
|
2334
|
+
Object.defineProperty(ManagerFlashRemoveLiquidityEvent, "p", {
|
|
2335
|
+
get: function () {
|
|
2336
|
+
return ManagerFlashRemoveLiquidityEvent.phantom();
|
|
2337
|
+
},
|
|
2338
|
+
enumerable: false,
|
|
2339
|
+
configurable: true
|
|
2340
|
+
});
|
|
2341
|
+
Object.defineProperty(ManagerFlashRemoveLiquidityEvent, "bcs", {
|
|
2342
|
+
get: function () {
|
|
2343
|
+
return bcs_1.bcs.struct("ManagerFlashRemoveLiquidityEvent", {
|
|
2344
|
+
index: bcs_1.bcs.u64(),
|
|
2345
|
+
liquidity_token: structs_1.TypeName.bcs,
|
|
2346
|
+
price: bcs_1.bcs.u64(),
|
|
2347
|
+
price_decimal: bcs_1.bcs.u64(),
|
|
2348
|
+
remove_amount: bcs_1.bcs.u64(),
|
|
2349
|
+
removed_usd: bcs_1.bcs.u64(),
|
|
2350
|
+
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
2351
|
+
});
|
|
2352
|
+
},
|
|
2353
|
+
enumerable: false,
|
|
2354
|
+
configurable: true
|
|
2355
|
+
});
|
|
2356
|
+
ManagerFlashRemoveLiquidityEvent.fromFields = function (fields) {
|
|
2357
|
+
return ManagerFlashRemoveLiquidityEvent.reified().new({
|
|
2358
|
+
index: (0, reified_1.decodeFromFields)("u64", fields.index),
|
|
2359
|
+
liquidityToken: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.liquidity_token),
|
|
2360
|
+
price: (0, reified_1.decodeFromFields)("u64", fields.price),
|
|
2361
|
+
priceDecimal: (0, reified_1.decodeFromFields)("u64", fields.price_decimal),
|
|
2362
|
+
removeAmount: (0, reified_1.decodeFromFields)("u64", fields.remove_amount),
|
|
2363
|
+
removedUsd: (0, reified_1.decodeFromFields)("u64", fields.removed_usd),
|
|
2364
|
+
u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
|
|
2365
|
+
});
|
|
2366
|
+
};
|
|
2367
|
+
ManagerFlashRemoveLiquidityEvent.fromFieldsWithTypes = function (item) {
|
|
2368
|
+
if (!isManagerFlashRemoveLiquidityEvent(item.type)) {
|
|
2369
|
+
throw new Error("not a ManagerFlashRemoveLiquidityEvent type");
|
|
2370
|
+
}
|
|
2371
|
+
return ManagerFlashRemoveLiquidityEvent.reified().new({
|
|
2372
|
+
index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
|
|
2373
|
+
liquidityToken: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.liquidity_token),
|
|
2374
|
+
price: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.price),
|
|
2375
|
+
priceDecimal: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.price_decimal),
|
|
2376
|
+
removeAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.remove_amount),
|
|
2377
|
+
removedUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.removed_usd),
|
|
2378
|
+
u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
|
|
2379
|
+
});
|
|
2380
|
+
};
|
|
2381
|
+
ManagerFlashRemoveLiquidityEvent.fromBcs = function (data) {
|
|
2382
|
+
return ManagerFlashRemoveLiquidityEvent.fromFields(ManagerFlashRemoveLiquidityEvent.bcs.parse(data));
|
|
2383
|
+
};
|
|
2384
|
+
ManagerFlashRemoveLiquidityEvent.prototype.toJSONField = function () {
|
|
2385
|
+
return {
|
|
2386
|
+
index: this.index.toString(),
|
|
2387
|
+
liquidityToken: this.liquidityToken.toJSONField(),
|
|
2388
|
+
price: this.price.toString(),
|
|
2389
|
+
priceDecimal: this.priceDecimal.toString(),
|
|
2390
|
+
removeAmount: this.removeAmount.toString(),
|
|
2391
|
+
removedUsd: this.removedUsd.toString(),
|
|
2392
|
+
u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
|
|
2393
|
+
};
|
|
2394
|
+
};
|
|
2395
|
+
ManagerFlashRemoveLiquidityEvent.prototype.toJSON = function () {
|
|
2396
|
+
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
2397
|
+
};
|
|
2398
|
+
ManagerFlashRemoveLiquidityEvent.fromJSONField = function (field) {
|
|
2399
|
+
return ManagerFlashRemoveLiquidityEvent.reified().new({
|
|
2400
|
+
index: (0, reified_1.decodeFromJSONField)("u64", field.index),
|
|
2401
|
+
liquidityToken: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.liquidityToken),
|
|
2402
|
+
price: (0, reified_1.decodeFromJSONField)("u64", field.price),
|
|
2403
|
+
priceDecimal: (0, reified_1.decodeFromJSONField)("u64", field.priceDecimal),
|
|
2404
|
+
removeAmount: (0, reified_1.decodeFromJSONField)("u64", field.removeAmount),
|
|
2405
|
+
removedUsd: (0, reified_1.decodeFromJSONField)("u64", field.removedUsd),
|
|
2406
|
+
u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
|
|
2407
|
+
});
|
|
2408
|
+
};
|
|
2409
|
+
ManagerFlashRemoveLiquidityEvent.fromJSON = function (json) {
|
|
2410
|
+
if (json.$typeName !== ManagerFlashRemoveLiquidityEvent.$typeName) {
|
|
2411
|
+
throw new Error("not a WithTwoGenerics json object");
|
|
2412
|
+
}
|
|
2413
|
+
return ManagerFlashRemoveLiquidityEvent.fromJSONField(json);
|
|
2414
|
+
};
|
|
2415
|
+
ManagerFlashRemoveLiquidityEvent.fromSuiParsedData = function (content) {
|
|
2416
|
+
if (content.dataType !== "moveObject") {
|
|
2417
|
+
throw new Error("not an object");
|
|
2418
|
+
}
|
|
2419
|
+
if (!isManagerFlashRemoveLiquidityEvent(content.type)) {
|
|
2420
|
+
throw new Error("object at ".concat(content.fields.id, " is not a ManagerFlashRemoveLiquidityEvent object"));
|
|
2421
|
+
}
|
|
2422
|
+
return ManagerFlashRemoveLiquidityEvent.fromFieldsWithTypes(content);
|
|
2423
|
+
};
|
|
2424
|
+
ManagerFlashRemoveLiquidityEvent.fromSuiObjectData = function (data) {
|
|
2425
|
+
if (data.bcs) {
|
|
2426
|
+
if (data.bcs.dataType !== "moveObject" || !isManagerFlashRemoveLiquidityEvent(data.bcs.type)) {
|
|
2427
|
+
throw new Error("object at is not a ManagerFlashRemoveLiquidityEvent object");
|
|
2428
|
+
}
|
|
2429
|
+
return ManagerFlashRemoveLiquidityEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
2430
|
+
}
|
|
2431
|
+
if (data.content) {
|
|
2432
|
+
return ManagerFlashRemoveLiquidityEvent.fromSuiParsedData(data.content);
|
|
2433
|
+
}
|
|
2434
|
+
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
2435
|
+
};
|
|
2436
|
+
ManagerFlashRemoveLiquidityEvent.fetch = function (client, id) {
|
|
2437
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2438
|
+
var res;
|
|
2439
|
+
var _a, _b;
|
|
2440
|
+
return __generator(this, function (_c) {
|
|
2441
|
+
switch (_c.label) {
|
|
2442
|
+
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
2443
|
+
case 1:
|
|
2444
|
+
res = _c.sent();
|
|
2445
|
+
if (res.error) {
|
|
2446
|
+
throw new Error("error fetching ManagerFlashRemoveLiquidityEvent object at id ".concat(id, ": ").concat(res.error.code));
|
|
2447
|
+
}
|
|
2448
|
+
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isManagerFlashRemoveLiquidityEvent(res.data.bcs.type)) {
|
|
2449
|
+
throw new Error("object at id ".concat(id, " is not a ManagerFlashRemoveLiquidityEvent object"));
|
|
2450
|
+
}
|
|
2451
|
+
return [2 /*return*/, ManagerFlashRemoveLiquidityEvent.fromSuiObjectData(res.data)];
|
|
2452
|
+
}
|
|
2453
|
+
});
|
|
2454
|
+
});
|
|
2455
|
+
};
|
|
2456
|
+
ManagerFlashRemoveLiquidityEvent.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::ManagerFlashRemoveLiquidityEvent");
|
|
2457
|
+
ManagerFlashRemoveLiquidityEvent.$numTypeParams = 0;
|
|
2458
|
+
ManagerFlashRemoveLiquidityEvent.$isPhantom = [];
|
|
2459
|
+
return ManagerFlashRemoveLiquidityEvent;
|
|
2460
|
+
}());
|
|
2461
|
+
exports.ManagerFlashRemoveLiquidityEvent = ManagerFlashRemoveLiquidityEvent;
|
|
2462
|
+
/* ============================== ManagerFlashRepayLiquidityEvent =============================== */
|
|
2463
|
+
function isManagerFlashRepayLiquidityEvent(type) {
|
|
2464
|
+
type = (0, util_1.compressSuiType)(type);
|
|
2465
|
+
return type === "".concat(index_1.PKG_V1, "::lp_pool::ManagerFlashRepayLiquidityEvent");
|
|
2466
|
+
}
|
|
2467
|
+
var ManagerFlashRepayLiquidityEvent = /** @class */ (function () {
|
|
2468
|
+
function ManagerFlashRepayLiquidityEvent(typeArgs, fields) {
|
|
2469
|
+
this.__StructClass = true;
|
|
2470
|
+
this.$typeName = ManagerFlashRepayLiquidityEvent.$typeName;
|
|
2471
|
+
this.$isPhantom = ManagerFlashRepayLiquidityEvent.$isPhantom;
|
|
2472
|
+
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([ManagerFlashRepayLiquidityEvent.$typeName], __read(typeArgs), false));
|
|
2473
|
+
this.$typeArgs = typeArgs;
|
|
2474
|
+
this.index = fields.index;
|
|
2475
|
+
this.liquidityToken = fields.liquidityToken;
|
|
2476
|
+
this.price = fields.price;
|
|
2477
|
+
this.priceDecimal = fields.priceDecimal;
|
|
2478
|
+
this.repaidAmount = fields.repaidAmount;
|
|
2479
|
+
this.repaidUsd = fields.repaidUsd;
|
|
2480
|
+
this.u64Padding = fields.u64Padding;
|
|
2481
|
+
}
|
|
2482
|
+
ManagerFlashRepayLiquidityEvent.reified = function () {
|
|
2483
|
+
var _this = this;
|
|
2484
|
+
return {
|
|
2485
|
+
typeName: ManagerFlashRepayLiquidityEvent.$typeName,
|
|
2486
|
+
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([ManagerFlashRepayLiquidityEvent.$typeName], [], false)),
|
|
2487
|
+
typeArgs: [],
|
|
2488
|
+
isPhantom: ManagerFlashRepayLiquidityEvent.$isPhantom,
|
|
2489
|
+
reifiedTypeArgs: [],
|
|
2490
|
+
fromFields: function (fields) { return ManagerFlashRepayLiquidityEvent.fromFields(fields); },
|
|
2491
|
+
fromFieldsWithTypes: function (item) { return ManagerFlashRepayLiquidityEvent.fromFieldsWithTypes(item); },
|
|
2492
|
+
fromBcs: function (data) { return ManagerFlashRepayLiquidityEvent.fromBcs(data); },
|
|
2493
|
+
bcs: ManagerFlashRepayLiquidityEvent.bcs,
|
|
2494
|
+
fromJSONField: function (field) { return ManagerFlashRepayLiquidityEvent.fromJSONField(field); },
|
|
2495
|
+
fromJSON: function (json) { return ManagerFlashRepayLiquidityEvent.fromJSON(json); },
|
|
2496
|
+
fromSuiParsedData: function (content) { return ManagerFlashRepayLiquidityEvent.fromSuiParsedData(content); },
|
|
2497
|
+
fromSuiObjectData: function (content) { return ManagerFlashRepayLiquidityEvent.fromSuiObjectData(content); },
|
|
2498
|
+
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
2499
|
+
return [2 /*return*/, ManagerFlashRepayLiquidityEvent.fetch(client, id)];
|
|
2500
|
+
}); }); },
|
|
2501
|
+
new: function (fields) {
|
|
2502
|
+
return new ManagerFlashRepayLiquidityEvent([], fields);
|
|
2503
|
+
},
|
|
2504
|
+
kind: "StructClassReified",
|
|
2505
|
+
};
|
|
2506
|
+
};
|
|
2507
|
+
Object.defineProperty(ManagerFlashRepayLiquidityEvent, "r", {
|
|
2508
|
+
get: function () {
|
|
2509
|
+
return ManagerFlashRepayLiquidityEvent.reified();
|
|
2510
|
+
},
|
|
2511
|
+
enumerable: false,
|
|
2512
|
+
configurable: true
|
|
2513
|
+
});
|
|
2514
|
+
ManagerFlashRepayLiquidityEvent.phantom = function () {
|
|
2515
|
+
return (0, reified_1.phantom)(ManagerFlashRepayLiquidityEvent.reified());
|
|
2516
|
+
};
|
|
2517
|
+
Object.defineProperty(ManagerFlashRepayLiquidityEvent, "p", {
|
|
2518
|
+
get: function () {
|
|
2519
|
+
return ManagerFlashRepayLiquidityEvent.phantom();
|
|
2520
|
+
},
|
|
2521
|
+
enumerable: false,
|
|
2522
|
+
configurable: true
|
|
2523
|
+
});
|
|
2524
|
+
Object.defineProperty(ManagerFlashRepayLiquidityEvent, "bcs", {
|
|
2525
|
+
get: function () {
|
|
2526
|
+
return bcs_1.bcs.struct("ManagerFlashRepayLiquidityEvent", {
|
|
2527
|
+
index: bcs_1.bcs.u64(),
|
|
2528
|
+
liquidity_token: structs_1.TypeName.bcs,
|
|
2529
|
+
price: bcs_1.bcs.u64(),
|
|
2530
|
+
price_decimal: bcs_1.bcs.u64(),
|
|
2531
|
+
repaid_amount: bcs_1.bcs.u64(),
|
|
2532
|
+
repaid_usd: bcs_1.bcs.u64(),
|
|
2533
|
+
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
2534
|
+
});
|
|
2535
|
+
},
|
|
2536
|
+
enumerable: false,
|
|
2537
|
+
configurable: true
|
|
2538
|
+
});
|
|
2539
|
+
ManagerFlashRepayLiquidityEvent.fromFields = function (fields) {
|
|
2540
|
+
return ManagerFlashRepayLiquidityEvent.reified().new({
|
|
2541
|
+
index: (0, reified_1.decodeFromFields)("u64", fields.index),
|
|
2542
|
+
liquidityToken: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.liquidity_token),
|
|
2543
|
+
price: (0, reified_1.decodeFromFields)("u64", fields.price),
|
|
2544
|
+
priceDecimal: (0, reified_1.decodeFromFields)("u64", fields.price_decimal),
|
|
2545
|
+
repaidAmount: (0, reified_1.decodeFromFields)("u64", fields.repaid_amount),
|
|
2546
|
+
repaidUsd: (0, reified_1.decodeFromFields)("u64", fields.repaid_usd),
|
|
2547
|
+
u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
|
|
2548
|
+
});
|
|
2549
|
+
};
|
|
2550
|
+
ManagerFlashRepayLiquidityEvent.fromFieldsWithTypes = function (item) {
|
|
2551
|
+
if (!isManagerFlashRepayLiquidityEvent(item.type)) {
|
|
2552
|
+
throw new Error("not a ManagerFlashRepayLiquidityEvent type");
|
|
2553
|
+
}
|
|
2554
|
+
return ManagerFlashRepayLiquidityEvent.reified().new({
|
|
2555
|
+
index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
|
|
2556
|
+
liquidityToken: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.liquidity_token),
|
|
2557
|
+
price: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.price),
|
|
2558
|
+
priceDecimal: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.price_decimal),
|
|
2559
|
+
repaidAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.repaid_amount),
|
|
2560
|
+
repaidUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.repaid_usd),
|
|
2561
|
+
u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
|
|
2562
|
+
});
|
|
2563
|
+
};
|
|
2564
|
+
ManagerFlashRepayLiquidityEvent.fromBcs = function (data) {
|
|
2565
|
+
return ManagerFlashRepayLiquidityEvent.fromFields(ManagerFlashRepayLiquidityEvent.bcs.parse(data));
|
|
2566
|
+
};
|
|
2567
|
+
ManagerFlashRepayLiquidityEvent.prototype.toJSONField = function () {
|
|
2568
|
+
return {
|
|
2569
|
+
index: this.index.toString(),
|
|
2570
|
+
liquidityToken: this.liquidityToken.toJSONField(),
|
|
2571
|
+
price: this.price.toString(),
|
|
2572
|
+
priceDecimal: this.priceDecimal.toString(),
|
|
2573
|
+
repaidAmount: this.repaidAmount.toString(),
|
|
2574
|
+
repaidUsd: this.repaidUsd.toString(),
|
|
2575
|
+
u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
|
|
2576
|
+
};
|
|
2577
|
+
};
|
|
2578
|
+
ManagerFlashRepayLiquidityEvent.prototype.toJSON = function () {
|
|
2579
|
+
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
2580
|
+
};
|
|
2581
|
+
ManagerFlashRepayLiquidityEvent.fromJSONField = function (field) {
|
|
2582
|
+
return ManagerFlashRepayLiquidityEvent.reified().new({
|
|
2583
|
+
index: (0, reified_1.decodeFromJSONField)("u64", field.index),
|
|
2584
|
+
liquidityToken: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.liquidityToken),
|
|
2585
|
+
price: (0, reified_1.decodeFromJSONField)("u64", field.price),
|
|
2586
|
+
priceDecimal: (0, reified_1.decodeFromJSONField)("u64", field.priceDecimal),
|
|
2587
|
+
repaidAmount: (0, reified_1.decodeFromJSONField)("u64", field.repaidAmount),
|
|
2588
|
+
repaidUsd: (0, reified_1.decodeFromJSONField)("u64", field.repaidUsd),
|
|
2589
|
+
u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
|
|
2590
|
+
});
|
|
2591
|
+
};
|
|
2592
|
+
ManagerFlashRepayLiquidityEvent.fromJSON = function (json) {
|
|
2593
|
+
if (json.$typeName !== ManagerFlashRepayLiquidityEvent.$typeName) {
|
|
2594
|
+
throw new Error("not a WithTwoGenerics json object");
|
|
2595
|
+
}
|
|
2596
|
+
return ManagerFlashRepayLiquidityEvent.fromJSONField(json);
|
|
2597
|
+
};
|
|
2598
|
+
ManagerFlashRepayLiquidityEvent.fromSuiParsedData = function (content) {
|
|
2599
|
+
if (content.dataType !== "moveObject") {
|
|
2600
|
+
throw new Error("not an object");
|
|
2601
|
+
}
|
|
2602
|
+
if (!isManagerFlashRepayLiquidityEvent(content.type)) {
|
|
2603
|
+
throw new Error("object at ".concat(content.fields.id, " is not a ManagerFlashRepayLiquidityEvent object"));
|
|
2604
|
+
}
|
|
2605
|
+
return ManagerFlashRepayLiquidityEvent.fromFieldsWithTypes(content);
|
|
2606
|
+
};
|
|
2607
|
+
ManagerFlashRepayLiquidityEvent.fromSuiObjectData = function (data) {
|
|
2608
|
+
if (data.bcs) {
|
|
2609
|
+
if (data.bcs.dataType !== "moveObject" || !isManagerFlashRepayLiquidityEvent(data.bcs.type)) {
|
|
2610
|
+
throw new Error("object at is not a ManagerFlashRepayLiquidityEvent object");
|
|
2611
|
+
}
|
|
2612
|
+
return ManagerFlashRepayLiquidityEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
2613
|
+
}
|
|
2614
|
+
if (data.content) {
|
|
2615
|
+
return ManagerFlashRepayLiquidityEvent.fromSuiParsedData(data.content);
|
|
2616
|
+
}
|
|
2617
|
+
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
2618
|
+
};
|
|
2619
|
+
ManagerFlashRepayLiquidityEvent.fetch = function (client, id) {
|
|
2620
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2621
|
+
var res;
|
|
2622
|
+
var _a, _b;
|
|
2623
|
+
return __generator(this, function (_c) {
|
|
2624
|
+
switch (_c.label) {
|
|
2625
|
+
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
2626
|
+
case 1:
|
|
2627
|
+
res = _c.sent();
|
|
2628
|
+
if (res.error) {
|
|
2629
|
+
throw new Error("error fetching ManagerFlashRepayLiquidityEvent object at id ".concat(id, ": ").concat(res.error.code));
|
|
2630
|
+
}
|
|
2631
|
+
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isManagerFlashRepayLiquidityEvent(res.data.bcs.type)) {
|
|
2632
|
+
throw new Error("object at id ".concat(id, " is not a ManagerFlashRepayLiquidityEvent object"));
|
|
2633
|
+
}
|
|
2634
|
+
return [2 /*return*/, ManagerFlashRepayLiquidityEvent.fromSuiObjectData(res.data)];
|
|
2635
|
+
}
|
|
2636
|
+
});
|
|
2637
|
+
});
|
|
2638
|
+
};
|
|
2639
|
+
ManagerFlashRepayLiquidityEvent.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::ManagerFlashRepayLiquidityEvent");
|
|
2640
|
+
ManagerFlashRepayLiquidityEvent.$numTypeParams = 0;
|
|
2641
|
+
ManagerFlashRepayLiquidityEvent.$isPhantom = [];
|
|
2642
|
+
return ManagerFlashRepayLiquidityEvent;
|
|
2643
|
+
}());
|
|
2644
|
+
exports.ManagerFlashRepayLiquidityEvent = ManagerFlashRepayLiquidityEvent;
|
|
2645
|
+
/* ============================== MarginConfig =============================== */
|
|
2646
|
+
function isMarginConfig(type) {
|
|
2647
|
+
type = (0, util_1.compressSuiType)(type);
|
|
2648
|
+
return type === "".concat(index_1.PKG_V1, "::lp_pool::MarginConfig");
|
|
2649
|
+
}
|
|
2650
|
+
var MarginConfig = /** @class */ (function () {
|
|
2651
|
+
function MarginConfig(typeArgs, fields) {
|
|
2652
|
+
this.__StructClass = true;
|
|
2653
|
+
this.$typeName = MarginConfig.$typeName;
|
|
2654
|
+
this.$isPhantom = MarginConfig.$isPhantom;
|
|
2655
|
+
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([MarginConfig.$typeName], __read(typeArgs), false));
|
|
2656
|
+
this.$typeArgs = typeArgs;
|
|
2657
|
+
this.basicBorrowRate0 = fields.basicBorrowRate0;
|
|
2658
|
+
this.basicBorrowRate1 = fields.basicBorrowRate1;
|
|
2659
|
+
this.basicBorrowRate2 = fields.basicBorrowRate2;
|
|
2660
|
+
this.utilizationThresholdBp0 = fields.utilizationThresholdBp0;
|
|
2661
|
+
this.utilizationThresholdBp1 = fields.utilizationThresholdBp1;
|
|
2662
|
+
this.borrowIntervalTsMs = fields.borrowIntervalTsMs;
|
|
2663
|
+
this.maxOrderReserveRatioBp = fields.maxOrderReserveRatioBp;
|
|
2664
|
+
this.u64Padding = fields.u64Padding;
|
|
2665
|
+
}
|
|
2666
|
+
MarginConfig.reified = function () {
|
|
2667
|
+
var _this = this;
|
|
2668
|
+
return {
|
|
2669
|
+
typeName: MarginConfig.$typeName,
|
|
2670
|
+
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([MarginConfig.$typeName], [], false)),
|
|
2671
|
+
typeArgs: [],
|
|
2672
|
+
isPhantom: MarginConfig.$isPhantom,
|
|
2673
|
+
reifiedTypeArgs: [],
|
|
2674
|
+
fromFields: function (fields) { return MarginConfig.fromFields(fields); },
|
|
2675
|
+
fromFieldsWithTypes: function (item) { return MarginConfig.fromFieldsWithTypes(item); },
|
|
2676
|
+
fromBcs: function (data) { return MarginConfig.fromBcs(data); },
|
|
2677
|
+
bcs: MarginConfig.bcs,
|
|
2678
|
+
fromJSONField: function (field) { return MarginConfig.fromJSONField(field); },
|
|
2679
|
+
fromJSON: function (json) { return MarginConfig.fromJSON(json); },
|
|
2680
|
+
fromSuiParsedData: function (content) { return MarginConfig.fromSuiParsedData(content); },
|
|
2681
|
+
fromSuiObjectData: function (content) { return MarginConfig.fromSuiObjectData(content); },
|
|
2682
|
+
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
2683
|
+
return [2 /*return*/, MarginConfig.fetch(client, id)];
|
|
2684
|
+
}); }); },
|
|
2685
|
+
new: function (fields) {
|
|
2686
|
+
return new MarginConfig([], fields);
|
|
2687
|
+
},
|
|
2688
|
+
kind: "StructClassReified",
|
|
2689
|
+
};
|
|
2690
|
+
};
|
|
2691
|
+
Object.defineProperty(MarginConfig, "r", {
|
|
2692
|
+
get: function () {
|
|
2693
|
+
return MarginConfig.reified();
|
|
2694
|
+
},
|
|
2695
|
+
enumerable: false,
|
|
2696
|
+
configurable: true
|
|
2697
|
+
});
|
|
2698
|
+
MarginConfig.phantom = function () {
|
|
2699
|
+
return (0, reified_1.phantom)(MarginConfig.reified());
|
|
2700
|
+
};
|
|
2701
|
+
Object.defineProperty(MarginConfig, "p", {
|
|
2702
|
+
get: function () {
|
|
2703
|
+
return MarginConfig.phantom();
|
|
2704
|
+
},
|
|
2705
|
+
enumerable: false,
|
|
2706
|
+
configurable: true
|
|
2707
|
+
});
|
|
2708
|
+
Object.defineProperty(MarginConfig, "bcs", {
|
|
2709
|
+
get: function () {
|
|
2710
|
+
return bcs_1.bcs.struct("MarginConfig", {
|
|
2711
|
+
basic_borrow_rate_0: bcs_1.bcs.u64(),
|
|
2712
|
+
basic_borrow_rate_1: bcs_1.bcs.u64(),
|
|
2713
|
+
basic_borrow_rate_2: bcs_1.bcs.u64(),
|
|
2714
|
+
utilization_threshold_bp_0: bcs_1.bcs.u64(),
|
|
2715
|
+
utilization_threshold_bp_1: bcs_1.bcs.u64(),
|
|
2716
|
+
borrow_interval_ts_ms: bcs_1.bcs.u64(),
|
|
2717
|
+
max_order_reserve_ratio_bp: bcs_1.bcs.u64(),
|
|
2718
|
+
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
2719
|
+
});
|
|
2720
|
+
},
|
|
2721
|
+
enumerable: false,
|
|
2722
|
+
configurable: true
|
|
2723
|
+
});
|
|
2724
|
+
MarginConfig.fromFields = function (fields) {
|
|
2725
|
+
return MarginConfig.reified().new({
|
|
2726
|
+
basicBorrowRate0: (0, reified_1.decodeFromFields)("u64", fields.basic_borrow_rate_0),
|
|
2727
|
+
basicBorrowRate1: (0, reified_1.decodeFromFields)("u64", fields.basic_borrow_rate_1),
|
|
2728
|
+
basicBorrowRate2: (0, reified_1.decodeFromFields)("u64", fields.basic_borrow_rate_2),
|
|
2729
|
+
utilizationThresholdBp0: (0, reified_1.decodeFromFields)("u64", fields.utilization_threshold_bp_0),
|
|
2730
|
+
utilizationThresholdBp1: (0, reified_1.decodeFromFields)("u64", fields.utilization_threshold_bp_1),
|
|
2731
|
+
borrowIntervalTsMs: (0, reified_1.decodeFromFields)("u64", fields.borrow_interval_ts_ms),
|
|
2732
|
+
maxOrderReserveRatioBp: (0, reified_1.decodeFromFields)("u64", fields.max_order_reserve_ratio_bp),
|
|
2733
|
+
u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
|
|
2734
|
+
});
|
|
2735
|
+
};
|
|
2736
|
+
MarginConfig.fromFieldsWithTypes = function (item) {
|
|
2737
|
+
if (!isMarginConfig(item.type)) {
|
|
2738
|
+
throw new Error("not a MarginConfig type");
|
|
2739
|
+
}
|
|
2740
|
+
return MarginConfig.reified().new({
|
|
2741
|
+
basicBorrowRate0: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.basic_borrow_rate_0),
|
|
2742
|
+
basicBorrowRate1: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.basic_borrow_rate_1),
|
|
2743
|
+
basicBorrowRate2: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.basic_borrow_rate_2),
|
|
2744
|
+
utilizationThresholdBp0: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.utilization_threshold_bp_0),
|
|
2745
|
+
utilizationThresholdBp1: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.utilization_threshold_bp_1),
|
|
2746
|
+
borrowIntervalTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.borrow_interval_ts_ms),
|
|
2747
|
+
maxOrderReserveRatioBp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.max_order_reserve_ratio_bp),
|
|
2748
|
+
u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
|
|
2749
|
+
});
|
|
2750
|
+
};
|
|
2751
|
+
MarginConfig.fromBcs = function (data) {
|
|
2752
|
+
return MarginConfig.fromFields(MarginConfig.bcs.parse(data));
|
|
2753
|
+
};
|
|
2754
|
+
MarginConfig.prototype.toJSONField = function () {
|
|
2755
|
+
return {
|
|
2756
|
+
basicBorrowRate0: this.basicBorrowRate0.toString(),
|
|
2757
|
+
basicBorrowRate1: this.basicBorrowRate1.toString(),
|
|
2758
|
+
basicBorrowRate2: this.basicBorrowRate2.toString(),
|
|
2759
|
+
utilizationThresholdBp0: this.utilizationThresholdBp0.toString(),
|
|
2760
|
+
utilizationThresholdBp1: this.utilizationThresholdBp1.toString(),
|
|
2761
|
+
borrowIntervalTsMs: this.borrowIntervalTsMs.toString(),
|
|
2762
|
+
maxOrderReserveRatioBp: this.maxOrderReserveRatioBp.toString(),
|
|
2763
|
+
u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
|
|
2764
|
+
};
|
|
2765
|
+
};
|
|
2766
|
+
MarginConfig.prototype.toJSON = function () {
|
|
2767
|
+
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
2768
|
+
};
|
|
2769
|
+
MarginConfig.fromJSONField = function (field) {
|
|
2770
|
+
return MarginConfig.reified().new({
|
|
2771
|
+
basicBorrowRate0: (0, reified_1.decodeFromJSONField)("u64", field.basicBorrowRate0),
|
|
2772
|
+
basicBorrowRate1: (0, reified_1.decodeFromJSONField)("u64", field.basicBorrowRate1),
|
|
2773
|
+
basicBorrowRate2: (0, reified_1.decodeFromJSONField)("u64", field.basicBorrowRate2),
|
|
2774
|
+
utilizationThresholdBp0: (0, reified_1.decodeFromJSONField)("u64", field.utilizationThresholdBp0),
|
|
2775
|
+
utilizationThresholdBp1: (0, reified_1.decodeFromJSONField)("u64", field.utilizationThresholdBp1),
|
|
2776
|
+
borrowIntervalTsMs: (0, reified_1.decodeFromJSONField)("u64", field.borrowIntervalTsMs),
|
|
2777
|
+
maxOrderReserveRatioBp: (0, reified_1.decodeFromJSONField)("u64", field.maxOrderReserveRatioBp),
|
|
2778
|
+
u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
|
|
2779
|
+
});
|
|
2780
|
+
};
|
|
2781
|
+
MarginConfig.fromJSON = function (json) {
|
|
2782
|
+
if (json.$typeName !== MarginConfig.$typeName) {
|
|
2783
|
+
throw new Error("not a WithTwoGenerics json object");
|
|
2784
|
+
}
|
|
2785
|
+
return MarginConfig.fromJSONField(json);
|
|
2786
|
+
};
|
|
2787
|
+
MarginConfig.fromSuiParsedData = function (content) {
|
|
2788
|
+
if (content.dataType !== "moveObject") {
|
|
2789
|
+
throw new Error("not an object");
|
|
2790
|
+
}
|
|
2791
|
+
if (!isMarginConfig(content.type)) {
|
|
2792
|
+
throw new Error("object at ".concat(content.fields.id, " is not a MarginConfig object"));
|
|
2793
|
+
}
|
|
2794
|
+
return MarginConfig.fromFieldsWithTypes(content);
|
|
2795
|
+
};
|
|
2796
|
+
MarginConfig.fromSuiObjectData = function (data) {
|
|
2797
|
+
if (data.bcs) {
|
|
2798
|
+
if (data.bcs.dataType !== "moveObject" || !isMarginConfig(data.bcs.type)) {
|
|
2799
|
+
throw new Error("object at is not a MarginConfig object");
|
|
2800
|
+
}
|
|
2801
|
+
return MarginConfig.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
2802
|
+
}
|
|
2803
|
+
if (data.content) {
|
|
2804
|
+
return MarginConfig.fromSuiParsedData(data.content);
|
|
2805
|
+
}
|
|
2806
|
+
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
2807
|
+
};
|
|
2808
|
+
MarginConfig.fetch = function (client, id) {
|
|
2809
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2810
|
+
var res;
|
|
2811
|
+
var _a, _b;
|
|
2812
|
+
return __generator(this, function (_c) {
|
|
2813
|
+
switch (_c.label) {
|
|
2814
|
+
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
2815
|
+
case 1:
|
|
2816
|
+
res = _c.sent();
|
|
2817
|
+
if (res.error) {
|
|
2818
|
+
throw new Error("error fetching MarginConfig object at id ".concat(id, ": ").concat(res.error.code));
|
|
2819
|
+
}
|
|
2820
|
+
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isMarginConfig(res.data.bcs.type)) {
|
|
2821
|
+
throw new Error("object at id ".concat(id, " is not a MarginConfig object"));
|
|
2822
|
+
}
|
|
2823
|
+
return [2 /*return*/, MarginConfig.fromSuiObjectData(res.data)];
|
|
2824
|
+
}
|
|
2825
|
+
});
|
|
2826
|
+
});
|
|
2827
|
+
};
|
|
2828
|
+
MarginConfig.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::MarginConfig");
|
|
2829
|
+
MarginConfig.$numTypeParams = 0;
|
|
2830
|
+
MarginConfig.$isPhantom = [];
|
|
2831
|
+
return MarginConfig;
|
|
2832
|
+
}());
|
|
2833
|
+
exports.MarginConfig = MarginConfig;
|
|
2834
|
+
/* ============================== MintLpEvent =============================== */
|
|
2835
|
+
function isMintLpEvent(type) {
|
|
2836
|
+
type = (0, util_1.compressSuiType)(type);
|
|
2837
|
+
return type === "".concat(index_1.PKG_V1, "::lp_pool::MintLpEvent");
|
|
2838
|
+
}
|
|
2839
|
+
var MintLpEvent = /** @class */ (function () {
|
|
2840
|
+
function MintLpEvent(typeArgs, fields) {
|
|
2841
|
+
this.__StructClass = true;
|
|
2842
|
+
this.$typeName = MintLpEvent.$typeName;
|
|
2843
|
+
this.$isPhantom = MintLpEvent.$isPhantom;
|
|
2844
|
+
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([MintLpEvent.$typeName], __read(typeArgs), false));
|
|
2845
|
+
this.$typeArgs = typeArgs;
|
|
2846
|
+
this.sender = fields.sender;
|
|
2847
|
+
this.index = fields.index;
|
|
2848
|
+
this.liquidityTokenType = fields.liquidityTokenType;
|
|
2849
|
+
this.depositAmount = fields.depositAmount;
|
|
2850
|
+
this.depositAmountUsd = fields.depositAmountUsd;
|
|
2851
|
+
this.mintFeeUsd = fields.mintFeeUsd;
|
|
2852
|
+
this.lpTokenType = fields.lpTokenType;
|
|
2853
|
+
this.mintedLpAmount = fields.mintedLpAmount;
|
|
2854
|
+
this.u64Padding = fields.u64Padding;
|
|
2855
|
+
}
|
|
2856
|
+
MintLpEvent.reified = function () {
|
|
2857
|
+
var _this = this;
|
|
2858
|
+
return {
|
|
2859
|
+
typeName: MintLpEvent.$typeName,
|
|
2860
|
+
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([MintLpEvent.$typeName], [], false)),
|
|
2861
|
+
typeArgs: [],
|
|
2862
|
+
isPhantom: MintLpEvent.$isPhantom,
|
|
2863
|
+
reifiedTypeArgs: [],
|
|
2864
|
+
fromFields: function (fields) { return MintLpEvent.fromFields(fields); },
|
|
2865
|
+
fromFieldsWithTypes: function (item) { return MintLpEvent.fromFieldsWithTypes(item); },
|
|
2866
|
+
fromBcs: function (data) { return MintLpEvent.fromBcs(data); },
|
|
2867
|
+
bcs: MintLpEvent.bcs,
|
|
2868
|
+
fromJSONField: function (field) { return MintLpEvent.fromJSONField(field); },
|
|
2869
|
+
fromJSON: function (json) { return MintLpEvent.fromJSON(json); },
|
|
2870
|
+
fromSuiParsedData: function (content) { return MintLpEvent.fromSuiParsedData(content); },
|
|
2871
|
+
fromSuiObjectData: function (content) { return MintLpEvent.fromSuiObjectData(content); },
|
|
2872
|
+
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
2873
|
+
return [2 /*return*/, MintLpEvent.fetch(client, id)];
|
|
2874
|
+
}); }); },
|
|
2875
|
+
new: function (fields) {
|
|
2876
|
+
return new MintLpEvent([], fields);
|
|
2877
|
+
},
|
|
2878
|
+
kind: "StructClassReified",
|
|
2879
|
+
};
|
|
2880
|
+
};
|
|
2881
|
+
Object.defineProperty(MintLpEvent, "r", {
|
|
2882
|
+
get: function () {
|
|
2883
|
+
return MintLpEvent.reified();
|
|
2884
|
+
},
|
|
2885
|
+
enumerable: false,
|
|
2886
|
+
configurable: true
|
|
2887
|
+
});
|
|
2888
|
+
MintLpEvent.phantom = function () {
|
|
2889
|
+
return (0, reified_1.phantom)(MintLpEvent.reified());
|
|
2890
|
+
};
|
|
2891
|
+
Object.defineProperty(MintLpEvent, "p", {
|
|
2892
|
+
get: function () {
|
|
2893
|
+
return MintLpEvent.phantom();
|
|
2894
|
+
},
|
|
2895
|
+
enumerable: false,
|
|
2896
|
+
configurable: true
|
|
2897
|
+
});
|
|
2898
|
+
Object.defineProperty(MintLpEvent, "bcs", {
|
|
2899
|
+
get: function () {
|
|
2900
|
+
return bcs_1.bcs.struct("MintLpEvent", {
|
|
2901
|
+
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); } }),
|
|
2902
|
+
index: bcs_1.bcs.u64(),
|
|
2903
|
+
liquidity_token_type: structs_1.TypeName.bcs,
|
|
2904
|
+
deposit_amount: bcs_1.bcs.u64(),
|
|
2905
|
+
deposit_amount_usd: bcs_1.bcs.u64(),
|
|
2906
|
+
mint_fee_usd: bcs_1.bcs.u64(),
|
|
2907
|
+
lp_token_type: structs_1.TypeName.bcs,
|
|
2908
|
+
minted_lp_amount: bcs_1.bcs.u64(),
|
|
2909
|
+
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
2910
|
+
});
|
|
2911
|
+
},
|
|
2912
|
+
enumerable: false,
|
|
2913
|
+
configurable: true
|
|
2914
|
+
});
|
|
2915
|
+
MintLpEvent.fromFields = function (fields) {
|
|
2916
|
+
return MintLpEvent.reified().new({
|
|
2917
|
+
sender: (0, reified_1.decodeFromFields)("address", fields.sender),
|
|
2918
|
+
index: (0, reified_1.decodeFromFields)("u64", fields.index),
|
|
2919
|
+
liquidityTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.liquidity_token_type),
|
|
2920
|
+
depositAmount: (0, reified_1.decodeFromFields)("u64", fields.deposit_amount),
|
|
2921
|
+
depositAmountUsd: (0, reified_1.decodeFromFields)("u64", fields.deposit_amount_usd),
|
|
2922
|
+
mintFeeUsd: (0, reified_1.decodeFromFields)("u64", fields.mint_fee_usd),
|
|
2923
|
+
lpTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.lp_token_type),
|
|
2924
|
+
mintedLpAmount: (0, reified_1.decodeFromFields)("u64", fields.minted_lp_amount),
|
|
2925
|
+
u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
|
|
2926
|
+
});
|
|
2927
|
+
};
|
|
2928
|
+
MintLpEvent.fromFieldsWithTypes = function (item) {
|
|
2929
|
+
if (!isMintLpEvent(item.type)) {
|
|
2930
|
+
throw new Error("not a MintLpEvent type");
|
|
2931
|
+
}
|
|
2932
|
+
return MintLpEvent.reified().new({
|
|
2933
|
+
sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
|
|
2934
|
+
index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
|
|
2935
|
+
liquidityTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.liquidity_token_type),
|
|
2936
|
+
depositAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.deposit_amount),
|
|
2937
|
+
depositAmountUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.deposit_amount_usd),
|
|
2938
|
+
mintFeeUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.mint_fee_usd),
|
|
2939
|
+
lpTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.lp_token_type),
|
|
2940
|
+
mintedLpAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.minted_lp_amount),
|
|
2941
|
+
u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
|
|
2942
|
+
});
|
|
2943
|
+
};
|
|
2944
|
+
MintLpEvent.fromBcs = function (data) {
|
|
2945
|
+
return MintLpEvent.fromFields(MintLpEvent.bcs.parse(data));
|
|
2946
|
+
};
|
|
2947
|
+
MintLpEvent.prototype.toJSONField = function () {
|
|
2948
|
+
return {
|
|
2949
|
+
sender: this.sender,
|
|
2950
|
+
index: this.index.toString(),
|
|
2951
|
+
liquidityTokenType: this.liquidityTokenType.toJSONField(),
|
|
2952
|
+
depositAmount: this.depositAmount.toString(),
|
|
2953
|
+
depositAmountUsd: this.depositAmountUsd.toString(),
|
|
2954
|
+
mintFeeUsd: this.mintFeeUsd.toString(),
|
|
2955
|
+
lpTokenType: this.lpTokenType.toJSONField(),
|
|
2956
|
+
mintedLpAmount: this.mintedLpAmount.toString(),
|
|
2957
|
+
u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
|
|
2958
|
+
};
|
|
2959
|
+
};
|
|
2960
|
+
MintLpEvent.prototype.toJSON = function () {
|
|
2961
|
+
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
2962
|
+
};
|
|
2963
|
+
MintLpEvent.fromJSONField = function (field) {
|
|
2964
|
+
return MintLpEvent.reified().new({
|
|
2965
|
+
sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
|
|
2966
|
+
index: (0, reified_1.decodeFromJSONField)("u64", field.index),
|
|
2967
|
+
liquidityTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.liquidityTokenType),
|
|
2968
|
+
depositAmount: (0, reified_1.decodeFromJSONField)("u64", field.depositAmount),
|
|
2969
|
+
depositAmountUsd: (0, reified_1.decodeFromJSONField)("u64", field.depositAmountUsd),
|
|
2970
|
+
mintFeeUsd: (0, reified_1.decodeFromJSONField)("u64", field.mintFeeUsd),
|
|
2971
|
+
lpTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.lpTokenType),
|
|
2972
|
+
mintedLpAmount: (0, reified_1.decodeFromJSONField)("u64", field.mintedLpAmount),
|
|
2973
|
+
u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
|
|
2974
|
+
});
|
|
2975
|
+
};
|
|
2976
|
+
MintLpEvent.fromJSON = function (json) {
|
|
2977
|
+
if (json.$typeName !== MintLpEvent.$typeName) {
|
|
2978
|
+
throw new Error("not a WithTwoGenerics json object");
|
|
2979
|
+
}
|
|
2980
|
+
return MintLpEvent.fromJSONField(json);
|
|
2981
|
+
};
|
|
2982
|
+
MintLpEvent.fromSuiParsedData = function (content) {
|
|
2983
|
+
if (content.dataType !== "moveObject") {
|
|
2984
|
+
throw new Error("not an object");
|
|
2985
|
+
}
|
|
2986
|
+
if (!isMintLpEvent(content.type)) {
|
|
2987
|
+
throw new Error("object at ".concat(content.fields.id, " is not a MintLpEvent object"));
|
|
2988
|
+
}
|
|
2989
|
+
return MintLpEvent.fromFieldsWithTypes(content);
|
|
2990
|
+
};
|
|
2991
|
+
MintLpEvent.fromSuiObjectData = function (data) {
|
|
2992
|
+
if (data.bcs) {
|
|
2993
|
+
if (data.bcs.dataType !== "moveObject" || !isMintLpEvent(data.bcs.type)) {
|
|
2994
|
+
throw new Error("object at is not a MintLpEvent object");
|
|
2995
|
+
}
|
|
2996
|
+
return MintLpEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
2997
|
+
}
|
|
2998
|
+
if (data.content) {
|
|
2999
|
+
return MintLpEvent.fromSuiParsedData(data.content);
|
|
3000
|
+
}
|
|
3001
|
+
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
3002
|
+
};
|
|
3003
|
+
MintLpEvent.fetch = function (client, id) {
|
|
3004
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3005
|
+
var res;
|
|
3006
|
+
var _a, _b;
|
|
3007
|
+
return __generator(this, function (_c) {
|
|
3008
|
+
switch (_c.label) {
|
|
3009
|
+
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
3010
|
+
case 1:
|
|
3011
|
+
res = _c.sent();
|
|
3012
|
+
if (res.error) {
|
|
3013
|
+
throw new Error("error fetching MintLpEvent object at id ".concat(id, ": ").concat(res.error.code));
|
|
3014
|
+
}
|
|
3015
|
+
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isMintLpEvent(res.data.bcs.type)) {
|
|
3016
|
+
throw new Error("object at id ".concat(id, " is not a MintLpEvent object"));
|
|
3017
|
+
}
|
|
3018
|
+
return [2 /*return*/, MintLpEvent.fromSuiObjectData(res.data)];
|
|
3019
|
+
}
|
|
3020
|
+
});
|
|
3021
|
+
});
|
|
3022
|
+
};
|
|
3023
|
+
MintLpEvent.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::MintLpEvent");
|
|
3024
|
+
MintLpEvent.$numTypeParams = 0;
|
|
3025
|
+
MintLpEvent.$isPhantom = [];
|
|
3026
|
+
return MintLpEvent;
|
|
3027
|
+
}());
|
|
3028
|
+
exports.MintLpEvent = MintLpEvent;
|
|
3029
|
+
/* ============================== NewLiquidityPoolEvent =============================== */
|
|
3030
|
+
function isNewLiquidityPoolEvent(type) {
|
|
3031
|
+
type = (0, util_1.compressSuiType)(type);
|
|
3032
|
+
return type === "".concat(index_1.PKG_V1, "::lp_pool::NewLiquidityPoolEvent");
|
|
3033
|
+
}
|
|
3034
|
+
var NewLiquidityPoolEvent = /** @class */ (function () {
|
|
3035
|
+
function NewLiquidityPoolEvent(typeArgs, fields) {
|
|
3036
|
+
this.__StructClass = true;
|
|
3037
|
+
this.$typeName = NewLiquidityPoolEvent.$typeName;
|
|
3038
|
+
this.$isPhantom = NewLiquidityPoolEvent.$isPhantom;
|
|
3039
|
+
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([NewLiquidityPoolEvent.$typeName], __read(typeArgs), false));
|
|
3040
|
+
this.$typeArgs = typeArgs;
|
|
3041
|
+
this.sender = fields.sender;
|
|
3042
|
+
this.index = fields.index;
|
|
3043
|
+
this.lpTokenType = fields.lpTokenType;
|
|
3044
|
+
this.lpTokenDecimal = fields.lpTokenDecimal;
|
|
3045
|
+
this.u64Padding = fields.u64Padding;
|
|
3046
|
+
}
|
|
3047
|
+
NewLiquidityPoolEvent.reified = function () {
|
|
3048
|
+
var _this = this;
|
|
3049
|
+
return {
|
|
3050
|
+
typeName: NewLiquidityPoolEvent.$typeName,
|
|
3051
|
+
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([NewLiquidityPoolEvent.$typeName], [], false)),
|
|
3052
|
+
typeArgs: [],
|
|
3053
|
+
isPhantom: NewLiquidityPoolEvent.$isPhantom,
|
|
3054
|
+
reifiedTypeArgs: [],
|
|
3055
|
+
fromFields: function (fields) { return NewLiquidityPoolEvent.fromFields(fields); },
|
|
3056
|
+
fromFieldsWithTypes: function (item) { return NewLiquidityPoolEvent.fromFieldsWithTypes(item); },
|
|
3057
|
+
fromBcs: function (data) { return NewLiquidityPoolEvent.fromBcs(data); },
|
|
3058
|
+
bcs: NewLiquidityPoolEvent.bcs,
|
|
3059
|
+
fromJSONField: function (field) { return NewLiquidityPoolEvent.fromJSONField(field); },
|
|
3060
|
+
fromJSON: function (json) { return NewLiquidityPoolEvent.fromJSON(json); },
|
|
3061
|
+
fromSuiParsedData: function (content) { return NewLiquidityPoolEvent.fromSuiParsedData(content); },
|
|
3062
|
+
fromSuiObjectData: function (content) { return NewLiquidityPoolEvent.fromSuiObjectData(content); },
|
|
3063
|
+
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
3064
|
+
return [2 /*return*/, NewLiquidityPoolEvent.fetch(client, id)];
|
|
3065
|
+
}); }); },
|
|
3066
|
+
new: function (fields) {
|
|
3067
|
+
return new NewLiquidityPoolEvent([], fields);
|
|
3068
|
+
},
|
|
3069
|
+
kind: "StructClassReified",
|
|
3070
|
+
};
|
|
3071
|
+
};
|
|
3072
|
+
Object.defineProperty(NewLiquidityPoolEvent, "r", {
|
|
3073
|
+
get: function () {
|
|
3074
|
+
return NewLiquidityPoolEvent.reified();
|
|
3075
|
+
},
|
|
3076
|
+
enumerable: false,
|
|
3077
|
+
configurable: true
|
|
3078
|
+
});
|
|
3079
|
+
NewLiquidityPoolEvent.phantom = function () {
|
|
3080
|
+
return (0, reified_1.phantom)(NewLiquidityPoolEvent.reified());
|
|
3081
|
+
};
|
|
3082
|
+
Object.defineProperty(NewLiquidityPoolEvent, "p", {
|
|
3083
|
+
get: function () {
|
|
3084
|
+
return NewLiquidityPoolEvent.phantom();
|
|
3085
|
+
},
|
|
3086
|
+
enumerable: false,
|
|
3087
|
+
configurable: true
|
|
3088
|
+
});
|
|
3089
|
+
Object.defineProperty(NewLiquidityPoolEvent, "bcs", {
|
|
3090
|
+
get: function () {
|
|
3091
|
+
return bcs_1.bcs.struct("NewLiquidityPoolEvent", {
|
|
3092
|
+
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); } }),
|
|
3093
|
+
index: bcs_1.bcs.u64(),
|
|
3094
|
+
lp_token_type: structs_1.TypeName.bcs,
|
|
3095
|
+
lp_token_decimal: bcs_1.bcs.u64(),
|
|
3096
|
+
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
3097
|
+
});
|
|
3098
|
+
},
|
|
3099
|
+
enumerable: false,
|
|
3100
|
+
configurable: true
|
|
3101
|
+
});
|
|
3102
|
+
NewLiquidityPoolEvent.fromFields = function (fields) {
|
|
3103
|
+
return NewLiquidityPoolEvent.reified().new({
|
|
3104
|
+
sender: (0, reified_1.decodeFromFields)("address", fields.sender),
|
|
3105
|
+
index: (0, reified_1.decodeFromFields)("u64", fields.index),
|
|
3106
|
+
lpTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.lp_token_type),
|
|
3107
|
+
lpTokenDecimal: (0, reified_1.decodeFromFields)("u64", fields.lp_token_decimal),
|
|
3108
|
+
u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
|
|
3109
|
+
});
|
|
3110
|
+
};
|
|
3111
|
+
NewLiquidityPoolEvent.fromFieldsWithTypes = function (item) {
|
|
3112
|
+
if (!isNewLiquidityPoolEvent(item.type)) {
|
|
3113
|
+
throw new Error("not a NewLiquidityPoolEvent type");
|
|
3114
|
+
}
|
|
3115
|
+
return NewLiquidityPoolEvent.reified().new({
|
|
3116
|
+
sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
|
|
3117
|
+
index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
|
|
3118
|
+
lpTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.lp_token_type),
|
|
3119
|
+
lpTokenDecimal: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.lp_token_decimal),
|
|
3120
|
+
u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
|
|
3121
|
+
});
|
|
3122
|
+
};
|
|
3123
|
+
NewLiquidityPoolEvent.fromBcs = function (data) {
|
|
3124
|
+
return NewLiquidityPoolEvent.fromFields(NewLiquidityPoolEvent.bcs.parse(data));
|
|
3125
|
+
};
|
|
3126
|
+
NewLiquidityPoolEvent.prototype.toJSONField = function () {
|
|
3127
|
+
return {
|
|
3128
|
+
sender: this.sender,
|
|
3129
|
+
index: this.index.toString(),
|
|
3130
|
+
lpTokenType: this.lpTokenType.toJSONField(),
|
|
3131
|
+
lpTokenDecimal: this.lpTokenDecimal.toString(),
|
|
3132
|
+
u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
|
|
3133
|
+
};
|
|
3134
|
+
};
|
|
3135
|
+
NewLiquidityPoolEvent.prototype.toJSON = function () {
|
|
3136
|
+
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
3137
|
+
};
|
|
3138
|
+
NewLiquidityPoolEvent.fromJSONField = function (field) {
|
|
3139
|
+
return NewLiquidityPoolEvent.reified().new({
|
|
3140
|
+
sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
|
|
3141
|
+
index: (0, reified_1.decodeFromJSONField)("u64", field.index),
|
|
3142
|
+
lpTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.lpTokenType),
|
|
3143
|
+
lpTokenDecimal: (0, reified_1.decodeFromJSONField)("u64", field.lpTokenDecimal),
|
|
3144
|
+
u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
|
|
3145
|
+
});
|
|
3146
|
+
};
|
|
3147
|
+
NewLiquidityPoolEvent.fromJSON = function (json) {
|
|
3148
|
+
if (json.$typeName !== NewLiquidityPoolEvent.$typeName) {
|
|
3149
|
+
throw new Error("not a WithTwoGenerics json object");
|
|
3150
|
+
}
|
|
3151
|
+
return NewLiquidityPoolEvent.fromJSONField(json);
|
|
3152
|
+
};
|
|
3153
|
+
NewLiquidityPoolEvent.fromSuiParsedData = function (content) {
|
|
3154
|
+
if (content.dataType !== "moveObject") {
|
|
3155
|
+
throw new Error("not an object");
|
|
3156
|
+
}
|
|
3157
|
+
if (!isNewLiquidityPoolEvent(content.type)) {
|
|
3158
|
+
throw new Error("object at ".concat(content.fields.id, " is not a NewLiquidityPoolEvent object"));
|
|
3159
|
+
}
|
|
3160
|
+
return NewLiquidityPoolEvent.fromFieldsWithTypes(content);
|
|
3161
|
+
};
|
|
3162
|
+
NewLiquidityPoolEvent.fromSuiObjectData = function (data) {
|
|
3163
|
+
if (data.bcs) {
|
|
3164
|
+
if (data.bcs.dataType !== "moveObject" || !isNewLiquidityPoolEvent(data.bcs.type)) {
|
|
3165
|
+
throw new Error("object at is not a NewLiquidityPoolEvent object");
|
|
3166
|
+
}
|
|
3167
|
+
return NewLiquidityPoolEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
3168
|
+
}
|
|
3169
|
+
if (data.content) {
|
|
3170
|
+
return NewLiquidityPoolEvent.fromSuiParsedData(data.content);
|
|
3171
|
+
}
|
|
3172
|
+
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
3173
|
+
};
|
|
3174
|
+
NewLiquidityPoolEvent.fetch = function (client, id) {
|
|
3175
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3176
|
+
var res;
|
|
3177
|
+
var _a, _b;
|
|
3178
|
+
return __generator(this, function (_c) {
|
|
3179
|
+
switch (_c.label) {
|
|
3180
|
+
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
3181
|
+
case 1:
|
|
3182
|
+
res = _c.sent();
|
|
3183
|
+
if (res.error) {
|
|
3184
|
+
throw new Error("error fetching NewLiquidityPoolEvent object at id ".concat(id, ": ").concat(res.error.code));
|
|
3185
|
+
}
|
|
3186
|
+
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isNewLiquidityPoolEvent(res.data.bcs.type)) {
|
|
3187
|
+
throw new Error("object at id ".concat(id, " is not a NewLiquidityPoolEvent object"));
|
|
3188
|
+
}
|
|
3189
|
+
return [2 /*return*/, NewLiquidityPoolEvent.fromSuiObjectData(res.data)];
|
|
3190
|
+
}
|
|
3191
|
+
});
|
|
3192
|
+
});
|
|
3193
|
+
};
|
|
3194
|
+
NewLiquidityPoolEvent.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::NewLiquidityPoolEvent");
|
|
3195
|
+
NewLiquidityPoolEvent.$numTypeParams = 0;
|
|
3196
|
+
NewLiquidityPoolEvent.$isPhantom = [];
|
|
3197
|
+
return NewLiquidityPoolEvent;
|
|
3198
|
+
}());
|
|
3199
|
+
exports.NewLiquidityPoolEvent = NewLiquidityPoolEvent;
|
|
3200
|
+
/* ============================== RebalanceEvent =============================== */
|
|
3201
|
+
function isRebalanceEvent(type) {
|
|
3202
|
+
type = (0, util_1.compressSuiType)(type);
|
|
3203
|
+
return type === "".concat(index_1.PKG_V1, "::lp_pool::RebalanceEvent");
|
|
3204
|
+
}
|
|
3205
|
+
var RebalanceEvent = /** @class */ (function () {
|
|
3206
|
+
function RebalanceEvent(typeArgs, fields) {
|
|
3207
|
+
this.__StructClass = true;
|
|
3208
|
+
this.$typeName = RebalanceEvent.$typeName;
|
|
3209
|
+
this.$isPhantom = RebalanceEvent.$isPhantom;
|
|
3210
|
+
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([RebalanceEvent.$typeName], __read(typeArgs), false));
|
|
3211
|
+
this.$typeArgs = typeArgs;
|
|
3212
|
+
this.index = fields.index;
|
|
3213
|
+
this.fromToken = fields.fromToken;
|
|
3214
|
+
this.toToken = fields.toToken;
|
|
3215
|
+
this.rebalanceAmount = fields.rebalanceAmount;
|
|
3216
|
+
this.fromTokenOraclePrice = fields.fromTokenOraclePrice;
|
|
3217
|
+
this.toTokenOraclePrice = fields.toTokenOraclePrice;
|
|
3218
|
+
this.reducedUsd = fields.reducedUsd;
|
|
3219
|
+
this.tvlUsd = fields.tvlUsd;
|
|
3220
|
+
this.fromTokenLiquidityAmount = fields.fromTokenLiquidityAmount;
|
|
3221
|
+
this.toTokenLiquidityAmount = fields.toTokenLiquidityAmount;
|
|
3222
|
+
this.u64Padding = fields.u64Padding;
|
|
3223
|
+
}
|
|
3224
|
+
RebalanceEvent.reified = function () {
|
|
3225
|
+
var _this = this;
|
|
3226
|
+
return {
|
|
3227
|
+
typeName: RebalanceEvent.$typeName,
|
|
3228
|
+
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([RebalanceEvent.$typeName], [], false)),
|
|
3229
|
+
typeArgs: [],
|
|
3230
|
+
isPhantom: RebalanceEvent.$isPhantom,
|
|
3231
|
+
reifiedTypeArgs: [],
|
|
3232
|
+
fromFields: function (fields) { return RebalanceEvent.fromFields(fields); },
|
|
3233
|
+
fromFieldsWithTypes: function (item) { return RebalanceEvent.fromFieldsWithTypes(item); },
|
|
3234
|
+
fromBcs: function (data) { return RebalanceEvent.fromBcs(data); },
|
|
3235
|
+
bcs: RebalanceEvent.bcs,
|
|
3236
|
+
fromJSONField: function (field) { return RebalanceEvent.fromJSONField(field); },
|
|
3237
|
+
fromJSON: function (json) { return RebalanceEvent.fromJSON(json); },
|
|
3238
|
+
fromSuiParsedData: function (content) { return RebalanceEvent.fromSuiParsedData(content); },
|
|
3239
|
+
fromSuiObjectData: function (content) { return RebalanceEvent.fromSuiObjectData(content); },
|
|
3240
|
+
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
3241
|
+
return [2 /*return*/, RebalanceEvent.fetch(client, id)];
|
|
3242
|
+
}); }); },
|
|
3243
|
+
new: function (fields) {
|
|
3244
|
+
return new RebalanceEvent([], fields);
|
|
3245
|
+
},
|
|
3246
|
+
kind: "StructClassReified",
|
|
3247
|
+
};
|
|
3248
|
+
};
|
|
3249
|
+
Object.defineProperty(RebalanceEvent, "r", {
|
|
3250
|
+
get: function () {
|
|
3251
|
+
return RebalanceEvent.reified();
|
|
3252
|
+
},
|
|
3253
|
+
enumerable: false,
|
|
3254
|
+
configurable: true
|
|
3255
|
+
});
|
|
3256
|
+
RebalanceEvent.phantom = function () {
|
|
3257
|
+
return (0, reified_1.phantom)(RebalanceEvent.reified());
|
|
3258
|
+
};
|
|
3259
|
+
Object.defineProperty(RebalanceEvent, "p", {
|
|
3260
|
+
get: function () {
|
|
3261
|
+
return RebalanceEvent.phantom();
|
|
3262
|
+
},
|
|
3263
|
+
enumerable: false,
|
|
3264
|
+
configurable: true
|
|
3265
|
+
});
|
|
3266
|
+
Object.defineProperty(RebalanceEvent, "bcs", {
|
|
3267
|
+
get: function () {
|
|
3268
|
+
return bcs_1.bcs.struct("RebalanceEvent", {
|
|
3269
|
+
index: bcs_1.bcs.u64(),
|
|
3270
|
+
from_token: structs_1.TypeName.bcs,
|
|
3271
|
+
to_token: structs_1.TypeName.bcs,
|
|
3272
|
+
rebalance_amount: bcs_1.bcs.u64(),
|
|
3273
|
+
from_token_oracle_price: bcs_1.bcs.u64(),
|
|
3274
|
+
to_token_oracle_price: bcs_1.bcs.u64(),
|
|
3275
|
+
reduced_usd: bcs_1.bcs.u64(),
|
|
3276
|
+
tvl_usd: bcs_1.bcs.u64(),
|
|
3277
|
+
from_token_liquidity_amount: bcs_1.bcs.u64(),
|
|
3278
|
+
to_token_liquidity_amount: bcs_1.bcs.u64(),
|
|
2028
3279
|
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
2029
3280
|
});
|
|
2030
3281
|
},
|
|
2031
3282
|
enumerable: false,
|
|
2032
3283
|
configurable: true
|
|
2033
3284
|
});
|
|
2034
|
-
|
|
2035
|
-
return
|
|
2036
|
-
sender: (0, reified_1.decodeFromFields)("address", fields.sender),
|
|
3285
|
+
RebalanceEvent.fromFields = function (fields) {
|
|
3286
|
+
return RebalanceEvent.reified().new({
|
|
2037
3287
|
index: (0, reified_1.decodeFromFields)("u64", fields.index),
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
3288
|
+
fromToken: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.from_token),
|
|
3289
|
+
toToken: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.to_token),
|
|
3290
|
+
rebalanceAmount: (0, reified_1.decodeFromFields)("u64", fields.rebalance_amount),
|
|
3291
|
+
fromTokenOraclePrice: (0, reified_1.decodeFromFields)("u64", fields.from_token_oracle_price),
|
|
3292
|
+
toTokenOraclePrice: (0, reified_1.decodeFromFields)("u64", fields.to_token_oracle_price),
|
|
3293
|
+
reducedUsd: (0, reified_1.decodeFromFields)("u64", fields.reduced_usd),
|
|
3294
|
+
tvlUsd: (0, reified_1.decodeFromFields)("u64", fields.tvl_usd),
|
|
3295
|
+
fromTokenLiquidityAmount: (0, reified_1.decodeFromFields)("u64", fields.from_token_liquidity_amount),
|
|
3296
|
+
toTokenLiquidityAmount: (0, reified_1.decodeFromFields)("u64", fields.to_token_liquidity_amount),
|
|
2044
3297
|
u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
|
|
2045
3298
|
});
|
|
2046
3299
|
};
|
|
2047
|
-
|
|
2048
|
-
if (!
|
|
2049
|
-
throw new Error("not a
|
|
3300
|
+
RebalanceEvent.fromFieldsWithTypes = function (item) {
|
|
3301
|
+
if (!isRebalanceEvent(item.type)) {
|
|
3302
|
+
throw new Error("not a RebalanceEvent type");
|
|
2050
3303
|
}
|
|
2051
|
-
return
|
|
2052
|
-
sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
|
|
3304
|
+
return RebalanceEvent.reified().new({
|
|
2053
3305
|
index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
3306
|
+
fromToken: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.from_token),
|
|
3307
|
+
toToken: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.to_token),
|
|
3308
|
+
rebalanceAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.rebalance_amount),
|
|
3309
|
+
fromTokenOraclePrice: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.from_token_oracle_price),
|
|
3310
|
+
toTokenOraclePrice: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.to_token_oracle_price),
|
|
3311
|
+
reducedUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.reduced_usd),
|
|
3312
|
+
tvlUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.tvl_usd),
|
|
3313
|
+
fromTokenLiquidityAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.from_token_liquidity_amount),
|
|
3314
|
+
toTokenLiquidityAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.to_token_liquidity_amount),
|
|
2060
3315
|
u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
|
|
2061
3316
|
});
|
|
2062
3317
|
};
|
|
2063
|
-
|
|
2064
|
-
return
|
|
3318
|
+
RebalanceEvent.fromBcs = function (data) {
|
|
3319
|
+
return RebalanceEvent.fromFields(RebalanceEvent.bcs.parse(data));
|
|
2065
3320
|
};
|
|
2066
|
-
|
|
3321
|
+
RebalanceEvent.prototype.toJSONField = function () {
|
|
2067
3322
|
return {
|
|
2068
|
-
sender: this.sender,
|
|
2069
3323
|
index: this.index.toString(),
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
3324
|
+
fromToken: this.fromToken.toJSONField(),
|
|
3325
|
+
toToken: this.toToken.toJSONField(),
|
|
3326
|
+
rebalanceAmount: this.rebalanceAmount.toString(),
|
|
3327
|
+
fromTokenOraclePrice: this.fromTokenOraclePrice.toString(),
|
|
3328
|
+
toTokenOraclePrice: this.toTokenOraclePrice.toString(),
|
|
3329
|
+
reducedUsd: this.reducedUsd.toString(),
|
|
3330
|
+
tvlUsd: this.tvlUsd.toString(),
|
|
3331
|
+
fromTokenLiquidityAmount: this.fromTokenLiquidityAmount.toString(),
|
|
3332
|
+
toTokenLiquidityAmount: this.toTokenLiquidityAmount.toString(),
|
|
2076
3333
|
u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
|
|
2077
3334
|
};
|
|
2078
3335
|
};
|
|
2079
|
-
|
|
3336
|
+
RebalanceEvent.prototype.toJSON = function () {
|
|
2080
3337
|
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
2081
3338
|
};
|
|
2082
|
-
|
|
2083
|
-
return
|
|
2084
|
-
sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
|
|
3339
|
+
RebalanceEvent.fromJSONField = function (field) {
|
|
3340
|
+
return RebalanceEvent.reified().new({
|
|
2085
3341
|
index: (0, reified_1.decodeFromJSONField)("u64", field.index),
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
3342
|
+
fromToken: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.fromToken),
|
|
3343
|
+
toToken: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.toToken),
|
|
3344
|
+
rebalanceAmount: (0, reified_1.decodeFromJSONField)("u64", field.rebalanceAmount),
|
|
3345
|
+
fromTokenOraclePrice: (0, reified_1.decodeFromJSONField)("u64", field.fromTokenOraclePrice),
|
|
3346
|
+
toTokenOraclePrice: (0, reified_1.decodeFromJSONField)("u64", field.toTokenOraclePrice),
|
|
3347
|
+
reducedUsd: (0, reified_1.decodeFromJSONField)("u64", field.reducedUsd),
|
|
3348
|
+
tvlUsd: (0, reified_1.decodeFromJSONField)("u64", field.tvlUsd),
|
|
3349
|
+
fromTokenLiquidityAmount: (0, reified_1.decodeFromJSONField)("u64", field.fromTokenLiquidityAmount),
|
|
3350
|
+
toTokenLiquidityAmount: (0, reified_1.decodeFromJSONField)("u64", field.toTokenLiquidityAmount),
|
|
2092
3351
|
u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
|
|
2093
3352
|
});
|
|
2094
3353
|
};
|
|
2095
|
-
|
|
2096
|
-
if (json.$typeName !==
|
|
3354
|
+
RebalanceEvent.fromJSON = function (json) {
|
|
3355
|
+
if (json.$typeName !== RebalanceEvent.$typeName) {
|
|
2097
3356
|
throw new Error("not a WithTwoGenerics json object");
|
|
2098
3357
|
}
|
|
2099
|
-
return
|
|
3358
|
+
return RebalanceEvent.fromJSONField(json);
|
|
2100
3359
|
};
|
|
2101
|
-
|
|
3360
|
+
RebalanceEvent.fromSuiParsedData = function (content) {
|
|
2102
3361
|
if (content.dataType !== "moveObject") {
|
|
2103
3362
|
throw new Error("not an object");
|
|
2104
3363
|
}
|
|
2105
|
-
if (!
|
|
2106
|
-
throw new Error("object at ".concat(content.fields.id, " is not a
|
|
3364
|
+
if (!isRebalanceEvent(content.type)) {
|
|
3365
|
+
throw new Error("object at ".concat(content.fields.id, " is not a RebalanceEvent object"));
|
|
2107
3366
|
}
|
|
2108
|
-
return
|
|
3367
|
+
return RebalanceEvent.fromFieldsWithTypes(content);
|
|
2109
3368
|
};
|
|
2110
|
-
|
|
3369
|
+
RebalanceEvent.fromSuiObjectData = function (data) {
|
|
2111
3370
|
if (data.bcs) {
|
|
2112
|
-
if (data.bcs.dataType !== "moveObject" || !
|
|
2113
|
-
throw new Error("object at is not a
|
|
3371
|
+
if (data.bcs.dataType !== "moveObject" || !isRebalanceEvent(data.bcs.type)) {
|
|
3372
|
+
throw new Error("object at is not a RebalanceEvent object");
|
|
2114
3373
|
}
|
|
2115
|
-
return
|
|
3374
|
+
return RebalanceEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
2116
3375
|
}
|
|
2117
3376
|
if (data.content) {
|
|
2118
|
-
return
|
|
3377
|
+
return RebalanceEvent.fromSuiParsedData(data.content);
|
|
2119
3378
|
}
|
|
2120
3379
|
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
2121
3380
|
};
|
|
2122
|
-
|
|
3381
|
+
RebalanceEvent.fetch = function (client, id) {
|
|
2123
3382
|
return __awaiter(this, void 0, void 0, function () {
|
|
2124
3383
|
var res;
|
|
2125
3384
|
var _a, _b;
|
|
@@ -2129,168 +3388,192 @@ var MintLpEvent = /** @class */ (function () {
|
|
|
2129
3388
|
case 1:
|
|
2130
3389
|
res = _c.sent();
|
|
2131
3390
|
if (res.error) {
|
|
2132
|
-
throw new Error("error fetching
|
|
3391
|
+
throw new Error("error fetching RebalanceEvent object at id ".concat(id, ": ").concat(res.error.code));
|
|
2133
3392
|
}
|
|
2134
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !
|
|
2135
|
-
throw new Error("object at id ".concat(id, " is not a
|
|
3393
|
+
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isRebalanceEvent(res.data.bcs.type)) {
|
|
3394
|
+
throw new Error("object at id ".concat(id, " is not a RebalanceEvent object"));
|
|
2136
3395
|
}
|
|
2137
|
-
return [2 /*return*/,
|
|
3396
|
+
return [2 /*return*/, RebalanceEvent.fromSuiObjectData(res.data)];
|
|
2138
3397
|
}
|
|
2139
3398
|
});
|
|
2140
3399
|
});
|
|
2141
3400
|
};
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
return
|
|
3401
|
+
RebalanceEvent.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::RebalanceEvent");
|
|
3402
|
+
RebalanceEvent.$numTypeParams = 0;
|
|
3403
|
+
RebalanceEvent.$isPhantom = [];
|
|
3404
|
+
return RebalanceEvent;
|
|
2146
3405
|
}());
|
|
2147
|
-
exports.
|
|
2148
|
-
/* ==============================
|
|
2149
|
-
function
|
|
3406
|
+
exports.RebalanceEvent = RebalanceEvent;
|
|
3407
|
+
/* ============================== RebalanceProcess =============================== */
|
|
3408
|
+
function isRebalanceProcess(type) {
|
|
2150
3409
|
type = (0, util_1.compressSuiType)(type);
|
|
2151
|
-
return type === "".concat(index_1.PKG_V1, "::lp_pool::
|
|
3410
|
+
return type === "".concat(index_1.PKG_V1, "::lp_pool::RebalanceProcess");
|
|
2152
3411
|
}
|
|
2153
|
-
var
|
|
2154
|
-
function
|
|
3412
|
+
var RebalanceProcess = /** @class */ (function () {
|
|
3413
|
+
function RebalanceProcess(typeArgs, fields) {
|
|
2155
3414
|
this.__StructClass = true;
|
|
2156
|
-
this.$typeName =
|
|
2157
|
-
this.$isPhantom =
|
|
2158
|
-
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([
|
|
3415
|
+
this.$typeName = RebalanceProcess.$typeName;
|
|
3416
|
+
this.$isPhantom = RebalanceProcess.$isPhantom;
|
|
3417
|
+
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([RebalanceProcess.$typeName], __read(typeArgs), false));
|
|
2159
3418
|
this.$typeArgs = typeArgs;
|
|
2160
|
-
this.sender = fields.sender;
|
|
2161
3419
|
this.index = fields.index;
|
|
2162
|
-
this.
|
|
2163
|
-
this.
|
|
2164
|
-
this.
|
|
3420
|
+
this.tokenTypeA = fields.tokenTypeA;
|
|
3421
|
+
this.tokenDecimalA = fields.tokenDecimalA;
|
|
3422
|
+
this.tokenAmountA = fields.tokenAmountA;
|
|
3423
|
+
this.oraclePriceA = fields.oraclePriceA;
|
|
3424
|
+
this.reducedUsd = fields.reducedUsd;
|
|
3425
|
+
this.tokenTypeB = fields.tokenTypeB;
|
|
3426
|
+
this.tokenDecimalB = fields.tokenDecimalB;
|
|
3427
|
+
this.oraclePriceB = fields.oraclePriceB;
|
|
2165
3428
|
}
|
|
2166
|
-
|
|
3429
|
+
RebalanceProcess.reified = function () {
|
|
2167
3430
|
var _this = this;
|
|
2168
3431
|
return {
|
|
2169
|
-
typeName:
|
|
2170
|
-
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([
|
|
3432
|
+
typeName: RebalanceProcess.$typeName,
|
|
3433
|
+
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([RebalanceProcess.$typeName], [], false)),
|
|
2171
3434
|
typeArgs: [],
|
|
2172
|
-
isPhantom:
|
|
3435
|
+
isPhantom: RebalanceProcess.$isPhantom,
|
|
2173
3436
|
reifiedTypeArgs: [],
|
|
2174
|
-
fromFields: function (fields) { return
|
|
2175
|
-
fromFieldsWithTypes: function (item) { return
|
|
2176
|
-
fromBcs: function (data) { return
|
|
2177
|
-
bcs:
|
|
2178
|
-
fromJSONField: function (field) { return
|
|
2179
|
-
fromJSON: function (json) { return
|
|
2180
|
-
fromSuiParsedData: function (content) { return
|
|
2181
|
-
fromSuiObjectData: function (content) { return
|
|
3437
|
+
fromFields: function (fields) { return RebalanceProcess.fromFields(fields); },
|
|
3438
|
+
fromFieldsWithTypes: function (item) { return RebalanceProcess.fromFieldsWithTypes(item); },
|
|
3439
|
+
fromBcs: function (data) { return RebalanceProcess.fromBcs(data); },
|
|
3440
|
+
bcs: RebalanceProcess.bcs,
|
|
3441
|
+
fromJSONField: function (field) { return RebalanceProcess.fromJSONField(field); },
|
|
3442
|
+
fromJSON: function (json) { return RebalanceProcess.fromJSON(json); },
|
|
3443
|
+
fromSuiParsedData: function (content) { return RebalanceProcess.fromSuiParsedData(content); },
|
|
3444
|
+
fromSuiObjectData: function (content) { return RebalanceProcess.fromSuiObjectData(content); },
|
|
2182
3445
|
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
2183
|
-
return [2 /*return*/,
|
|
3446
|
+
return [2 /*return*/, RebalanceProcess.fetch(client, id)];
|
|
2184
3447
|
}); }); },
|
|
2185
3448
|
new: function (fields) {
|
|
2186
|
-
return new
|
|
3449
|
+
return new RebalanceProcess([], fields);
|
|
2187
3450
|
},
|
|
2188
3451
|
kind: "StructClassReified",
|
|
2189
3452
|
};
|
|
2190
3453
|
};
|
|
2191
|
-
Object.defineProperty(
|
|
3454
|
+
Object.defineProperty(RebalanceProcess, "r", {
|
|
2192
3455
|
get: function () {
|
|
2193
|
-
return
|
|
3456
|
+
return RebalanceProcess.reified();
|
|
2194
3457
|
},
|
|
2195
3458
|
enumerable: false,
|
|
2196
3459
|
configurable: true
|
|
2197
3460
|
});
|
|
2198
|
-
|
|
2199
|
-
return (0, reified_1.phantom)(
|
|
3461
|
+
RebalanceProcess.phantom = function () {
|
|
3462
|
+
return (0, reified_1.phantom)(RebalanceProcess.reified());
|
|
2200
3463
|
};
|
|
2201
|
-
Object.defineProperty(
|
|
3464
|
+
Object.defineProperty(RebalanceProcess, "p", {
|
|
2202
3465
|
get: function () {
|
|
2203
|
-
return
|
|
3466
|
+
return RebalanceProcess.phantom();
|
|
2204
3467
|
},
|
|
2205
3468
|
enumerable: false,
|
|
2206
3469
|
configurable: true
|
|
2207
3470
|
});
|
|
2208
|
-
Object.defineProperty(
|
|
3471
|
+
Object.defineProperty(RebalanceProcess, "bcs", {
|
|
2209
3472
|
get: function () {
|
|
2210
|
-
return bcs_1.bcs.struct("
|
|
2211
|
-
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); } }),
|
|
3473
|
+
return bcs_1.bcs.struct("RebalanceProcess", {
|
|
2212
3474
|
index: bcs_1.bcs.u64(),
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
3475
|
+
token_type_a: structs_1.TypeName.bcs,
|
|
3476
|
+
token_decimal_a: bcs_1.bcs.u64(),
|
|
3477
|
+
token_amount_a: bcs_1.bcs.u64(),
|
|
3478
|
+
oracle_price_a: bcs_1.bcs.u64(),
|
|
3479
|
+
reduced_usd: bcs_1.bcs.u64(),
|
|
3480
|
+
token_type_b: structs_1.TypeName.bcs,
|
|
3481
|
+
token_decimal_b: bcs_1.bcs.u64(),
|
|
3482
|
+
oracle_price_b: bcs_1.bcs.u64(),
|
|
2216
3483
|
});
|
|
2217
3484
|
},
|
|
2218
3485
|
enumerable: false,
|
|
2219
3486
|
configurable: true
|
|
2220
3487
|
});
|
|
2221
|
-
|
|
2222
|
-
return
|
|
2223
|
-
sender: (0, reified_1.decodeFromFields)("address", fields.sender),
|
|
3488
|
+
RebalanceProcess.fromFields = function (fields) {
|
|
3489
|
+
return RebalanceProcess.reified().new({
|
|
2224
3490
|
index: (0, reified_1.decodeFromFields)("u64", fields.index),
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
3491
|
+
tokenTypeA: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.token_type_a),
|
|
3492
|
+
tokenDecimalA: (0, reified_1.decodeFromFields)("u64", fields.token_decimal_a),
|
|
3493
|
+
tokenAmountA: (0, reified_1.decodeFromFields)("u64", fields.token_amount_a),
|
|
3494
|
+
oraclePriceA: (0, reified_1.decodeFromFields)("u64", fields.oracle_price_a),
|
|
3495
|
+
reducedUsd: (0, reified_1.decodeFromFields)("u64", fields.reduced_usd),
|
|
3496
|
+
tokenTypeB: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.token_type_b),
|
|
3497
|
+
tokenDecimalB: (0, reified_1.decodeFromFields)("u64", fields.token_decimal_b),
|
|
3498
|
+
oraclePriceB: (0, reified_1.decodeFromFields)("u64", fields.oracle_price_b),
|
|
2228
3499
|
});
|
|
2229
3500
|
};
|
|
2230
|
-
|
|
2231
|
-
if (!
|
|
2232
|
-
throw new Error("not a
|
|
3501
|
+
RebalanceProcess.fromFieldsWithTypes = function (item) {
|
|
3502
|
+
if (!isRebalanceProcess(item.type)) {
|
|
3503
|
+
throw new Error("not a RebalanceProcess type");
|
|
2233
3504
|
}
|
|
2234
|
-
return
|
|
2235
|
-
sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
|
|
3505
|
+
return RebalanceProcess.reified().new({
|
|
2236
3506
|
index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
3507
|
+
tokenTypeA: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.token_type_a),
|
|
3508
|
+
tokenDecimalA: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.token_decimal_a),
|
|
3509
|
+
tokenAmountA: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.token_amount_a),
|
|
3510
|
+
oraclePriceA: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.oracle_price_a),
|
|
3511
|
+
reducedUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.reduced_usd),
|
|
3512
|
+
tokenTypeB: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.token_type_b),
|
|
3513
|
+
tokenDecimalB: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.token_decimal_b),
|
|
3514
|
+
oraclePriceB: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.oracle_price_b),
|
|
2240
3515
|
});
|
|
2241
3516
|
};
|
|
2242
|
-
|
|
2243
|
-
return
|
|
3517
|
+
RebalanceProcess.fromBcs = function (data) {
|
|
3518
|
+
return RebalanceProcess.fromFields(RebalanceProcess.bcs.parse(data));
|
|
2244
3519
|
};
|
|
2245
|
-
|
|
3520
|
+
RebalanceProcess.prototype.toJSONField = function () {
|
|
2246
3521
|
return {
|
|
2247
|
-
sender: this.sender,
|
|
2248
3522
|
index: this.index.toString(),
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
3523
|
+
tokenTypeA: this.tokenTypeA.toJSONField(),
|
|
3524
|
+
tokenDecimalA: this.tokenDecimalA.toString(),
|
|
3525
|
+
tokenAmountA: this.tokenAmountA.toString(),
|
|
3526
|
+
oraclePriceA: this.oraclePriceA.toString(),
|
|
3527
|
+
reducedUsd: this.reducedUsd.toString(),
|
|
3528
|
+
tokenTypeB: this.tokenTypeB.toJSONField(),
|
|
3529
|
+
tokenDecimalB: this.tokenDecimalB.toString(),
|
|
3530
|
+
oraclePriceB: this.oraclePriceB.toString(),
|
|
2252
3531
|
};
|
|
2253
3532
|
};
|
|
2254
|
-
|
|
3533
|
+
RebalanceProcess.prototype.toJSON = function () {
|
|
2255
3534
|
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
2256
3535
|
};
|
|
2257
|
-
|
|
2258
|
-
return
|
|
2259
|
-
sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
|
|
3536
|
+
RebalanceProcess.fromJSONField = function (field) {
|
|
3537
|
+
return RebalanceProcess.reified().new({
|
|
2260
3538
|
index: (0, reified_1.decodeFromJSONField)("u64", field.index),
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
3539
|
+
tokenTypeA: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.tokenTypeA),
|
|
3540
|
+
tokenDecimalA: (0, reified_1.decodeFromJSONField)("u64", field.tokenDecimalA),
|
|
3541
|
+
tokenAmountA: (0, reified_1.decodeFromJSONField)("u64", field.tokenAmountA),
|
|
3542
|
+
oraclePriceA: (0, reified_1.decodeFromJSONField)("u64", field.oraclePriceA),
|
|
3543
|
+
reducedUsd: (0, reified_1.decodeFromJSONField)("u64", field.reducedUsd),
|
|
3544
|
+
tokenTypeB: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.tokenTypeB),
|
|
3545
|
+
tokenDecimalB: (0, reified_1.decodeFromJSONField)("u64", field.tokenDecimalB),
|
|
3546
|
+
oraclePriceB: (0, reified_1.decodeFromJSONField)("u64", field.oraclePriceB),
|
|
2264
3547
|
});
|
|
2265
3548
|
};
|
|
2266
|
-
|
|
2267
|
-
if (json.$typeName !==
|
|
3549
|
+
RebalanceProcess.fromJSON = function (json) {
|
|
3550
|
+
if (json.$typeName !== RebalanceProcess.$typeName) {
|
|
2268
3551
|
throw new Error("not a WithTwoGenerics json object");
|
|
2269
3552
|
}
|
|
2270
|
-
return
|
|
3553
|
+
return RebalanceProcess.fromJSONField(json);
|
|
2271
3554
|
};
|
|
2272
|
-
|
|
3555
|
+
RebalanceProcess.fromSuiParsedData = function (content) {
|
|
2273
3556
|
if (content.dataType !== "moveObject") {
|
|
2274
3557
|
throw new Error("not an object");
|
|
2275
3558
|
}
|
|
2276
|
-
if (!
|
|
2277
|
-
throw new Error("object at ".concat(content.fields.id, " is not a
|
|
3559
|
+
if (!isRebalanceProcess(content.type)) {
|
|
3560
|
+
throw new Error("object at ".concat(content.fields.id, " is not a RebalanceProcess object"));
|
|
2278
3561
|
}
|
|
2279
|
-
return
|
|
3562
|
+
return RebalanceProcess.fromFieldsWithTypes(content);
|
|
2280
3563
|
};
|
|
2281
|
-
|
|
3564
|
+
RebalanceProcess.fromSuiObjectData = function (data) {
|
|
2282
3565
|
if (data.bcs) {
|
|
2283
|
-
if (data.bcs.dataType !== "moveObject" || !
|
|
2284
|
-
throw new Error("object at is not a
|
|
3566
|
+
if (data.bcs.dataType !== "moveObject" || !isRebalanceProcess(data.bcs.type)) {
|
|
3567
|
+
throw new Error("object at is not a RebalanceProcess object");
|
|
2285
3568
|
}
|
|
2286
|
-
return
|
|
3569
|
+
return RebalanceProcess.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
2287
3570
|
}
|
|
2288
3571
|
if (data.content) {
|
|
2289
|
-
return
|
|
3572
|
+
return RebalanceProcess.fromSuiParsedData(data.content);
|
|
2290
3573
|
}
|
|
2291
3574
|
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
2292
3575
|
};
|
|
2293
|
-
|
|
3576
|
+
RebalanceProcess.fetch = function (client, id) {
|
|
2294
3577
|
return __awaiter(this, void 0, void 0, function () {
|
|
2295
3578
|
var res;
|
|
2296
3579
|
var _a, _b;
|
|
@@ -2300,22 +3583,22 @@ var NewLiquidityPoolEvent = /** @class */ (function () {
|
|
|
2300
3583
|
case 1:
|
|
2301
3584
|
res = _c.sent();
|
|
2302
3585
|
if (res.error) {
|
|
2303
|
-
throw new Error("error fetching
|
|
3586
|
+
throw new Error("error fetching RebalanceProcess object at id ".concat(id, ": ").concat(res.error.code));
|
|
2304
3587
|
}
|
|
2305
|
-
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !
|
|
2306
|
-
throw new Error("object at id ".concat(id, " is not a
|
|
3588
|
+
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isRebalanceProcess(res.data.bcs.type)) {
|
|
3589
|
+
throw new Error("object at id ".concat(id, " is not a RebalanceProcess object"));
|
|
2307
3590
|
}
|
|
2308
|
-
return [2 /*return*/,
|
|
3591
|
+
return [2 /*return*/, RebalanceProcess.fromSuiObjectData(res.data)];
|
|
2309
3592
|
}
|
|
2310
3593
|
});
|
|
2311
3594
|
});
|
|
2312
3595
|
};
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
return
|
|
3596
|
+
RebalanceProcess.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::RebalanceProcess");
|
|
3597
|
+
RebalanceProcess.$numTypeParams = 0;
|
|
3598
|
+
RebalanceProcess.$isPhantom = [];
|
|
3599
|
+
return RebalanceProcess;
|
|
2317
3600
|
}());
|
|
2318
|
-
exports.
|
|
3601
|
+
exports.RebalanceProcess = RebalanceProcess;
|
|
2319
3602
|
/* ============================== RedeemEvent =============================== */
|
|
2320
3603
|
function isRedeemEvent(type) {
|
|
2321
3604
|
type = (0, util_1.compressSuiType)(type);
|
|
@@ -4985,6 +6268,177 @@ var UpdateMarginConfigEvent = /** @class */ (function () {
|
|
|
4985
6268
|
return UpdateMarginConfigEvent;
|
|
4986
6269
|
}());
|
|
4987
6270
|
exports.UpdateMarginConfigEvent = UpdateMarginConfigEvent;
|
|
6271
|
+
/* ============================== UpdateRebalanceCostThresholdBpEvent =============================== */
|
|
6272
|
+
function isUpdateRebalanceCostThresholdBpEvent(type) {
|
|
6273
|
+
type = (0, util_1.compressSuiType)(type);
|
|
6274
|
+
return type === "".concat(index_1.PKG_V1, "::lp_pool::UpdateRebalanceCostThresholdBpEvent");
|
|
6275
|
+
}
|
|
6276
|
+
var UpdateRebalanceCostThresholdBpEvent = /** @class */ (function () {
|
|
6277
|
+
function UpdateRebalanceCostThresholdBpEvent(typeArgs, fields) {
|
|
6278
|
+
this.__StructClass = true;
|
|
6279
|
+
this.$typeName = UpdateRebalanceCostThresholdBpEvent.$typeName;
|
|
6280
|
+
this.$isPhantom = UpdateRebalanceCostThresholdBpEvent.$isPhantom;
|
|
6281
|
+
this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([UpdateRebalanceCostThresholdBpEvent.$typeName], __read(typeArgs), false));
|
|
6282
|
+
this.$typeArgs = typeArgs;
|
|
6283
|
+
this.sender = fields.sender;
|
|
6284
|
+
this.index = fields.index;
|
|
6285
|
+
this.previousRebalanceCostThresholdBp = fields.previousRebalanceCostThresholdBp;
|
|
6286
|
+
this.newRebalanceCostThresholdBp = fields.newRebalanceCostThresholdBp;
|
|
6287
|
+
this.u64Padding = fields.u64Padding;
|
|
6288
|
+
}
|
|
6289
|
+
UpdateRebalanceCostThresholdBpEvent.reified = function () {
|
|
6290
|
+
var _this = this;
|
|
6291
|
+
return {
|
|
6292
|
+
typeName: UpdateRebalanceCostThresholdBpEvent.$typeName,
|
|
6293
|
+
fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([UpdateRebalanceCostThresholdBpEvent.$typeName], [], false)),
|
|
6294
|
+
typeArgs: [],
|
|
6295
|
+
isPhantom: UpdateRebalanceCostThresholdBpEvent.$isPhantom,
|
|
6296
|
+
reifiedTypeArgs: [],
|
|
6297
|
+
fromFields: function (fields) { return UpdateRebalanceCostThresholdBpEvent.fromFields(fields); },
|
|
6298
|
+
fromFieldsWithTypes: function (item) { return UpdateRebalanceCostThresholdBpEvent.fromFieldsWithTypes(item); },
|
|
6299
|
+
fromBcs: function (data) { return UpdateRebalanceCostThresholdBpEvent.fromBcs(data); },
|
|
6300
|
+
bcs: UpdateRebalanceCostThresholdBpEvent.bcs,
|
|
6301
|
+
fromJSONField: function (field) { return UpdateRebalanceCostThresholdBpEvent.fromJSONField(field); },
|
|
6302
|
+
fromJSON: function (json) { return UpdateRebalanceCostThresholdBpEvent.fromJSON(json); },
|
|
6303
|
+
fromSuiParsedData: function (content) { return UpdateRebalanceCostThresholdBpEvent.fromSuiParsedData(content); },
|
|
6304
|
+
fromSuiObjectData: function (content) { return UpdateRebalanceCostThresholdBpEvent.fromSuiObjectData(content); },
|
|
6305
|
+
fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
6306
|
+
return [2 /*return*/, UpdateRebalanceCostThresholdBpEvent.fetch(client, id)];
|
|
6307
|
+
}); }); },
|
|
6308
|
+
new: function (fields) {
|
|
6309
|
+
return new UpdateRebalanceCostThresholdBpEvent([], fields);
|
|
6310
|
+
},
|
|
6311
|
+
kind: "StructClassReified",
|
|
6312
|
+
};
|
|
6313
|
+
};
|
|
6314
|
+
Object.defineProperty(UpdateRebalanceCostThresholdBpEvent, "r", {
|
|
6315
|
+
get: function () {
|
|
6316
|
+
return UpdateRebalanceCostThresholdBpEvent.reified();
|
|
6317
|
+
},
|
|
6318
|
+
enumerable: false,
|
|
6319
|
+
configurable: true
|
|
6320
|
+
});
|
|
6321
|
+
UpdateRebalanceCostThresholdBpEvent.phantom = function () {
|
|
6322
|
+
return (0, reified_1.phantom)(UpdateRebalanceCostThresholdBpEvent.reified());
|
|
6323
|
+
};
|
|
6324
|
+
Object.defineProperty(UpdateRebalanceCostThresholdBpEvent, "p", {
|
|
6325
|
+
get: function () {
|
|
6326
|
+
return UpdateRebalanceCostThresholdBpEvent.phantom();
|
|
6327
|
+
},
|
|
6328
|
+
enumerable: false,
|
|
6329
|
+
configurable: true
|
|
6330
|
+
});
|
|
6331
|
+
Object.defineProperty(UpdateRebalanceCostThresholdBpEvent, "bcs", {
|
|
6332
|
+
get: function () {
|
|
6333
|
+
return bcs_1.bcs.struct("UpdateRebalanceCostThresholdBpEvent", {
|
|
6334
|
+
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); } }),
|
|
6335
|
+
index: bcs_1.bcs.u64(),
|
|
6336
|
+
previous_rebalance_cost_threshold_bp: bcs_1.bcs.u64(),
|
|
6337
|
+
new_rebalance_cost_threshold_bp: bcs_1.bcs.u64(),
|
|
6338
|
+
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
6339
|
+
});
|
|
6340
|
+
},
|
|
6341
|
+
enumerable: false,
|
|
6342
|
+
configurable: true
|
|
6343
|
+
});
|
|
6344
|
+
UpdateRebalanceCostThresholdBpEvent.fromFields = function (fields) {
|
|
6345
|
+
return UpdateRebalanceCostThresholdBpEvent.reified().new({
|
|
6346
|
+
sender: (0, reified_1.decodeFromFields)("address", fields.sender),
|
|
6347
|
+
index: (0, reified_1.decodeFromFields)("u64", fields.index),
|
|
6348
|
+
previousRebalanceCostThresholdBp: (0, reified_1.decodeFromFields)("u64", fields.previous_rebalance_cost_threshold_bp),
|
|
6349
|
+
newRebalanceCostThresholdBp: (0, reified_1.decodeFromFields)("u64", fields.new_rebalance_cost_threshold_bp),
|
|
6350
|
+
u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
|
|
6351
|
+
});
|
|
6352
|
+
};
|
|
6353
|
+
UpdateRebalanceCostThresholdBpEvent.fromFieldsWithTypes = function (item) {
|
|
6354
|
+
if (!isUpdateRebalanceCostThresholdBpEvent(item.type)) {
|
|
6355
|
+
throw new Error("not a UpdateRebalanceCostThresholdBpEvent type");
|
|
6356
|
+
}
|
|
6357
|
+
return UpdateRebalanceCostThresholdBpEvent.reified().new({
|
|
6358
|
+
sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
|
|
6359
|
+
index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
|
|
6360
|
+
previousRebalanceCostThresholdBp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.previous_rebalance_cost_threshold_bp),
|
|
6361
|
+
newRebalanceCostThresholdBp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.new_rebalance_cost_threshold_bp),
|
|
6362
|
+
u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
|
|
6363
|
+
});
|
|
6364
|
+
};
|
|
6365
|
+
UpdateRebalanceCostThresholdBpEvent.fromBcs = function (data) {
|
|
6366
|
+
return UpdateRebalanceCostThresholdBpEvent.fromFields(UpdateRebalanceCostThresholdBpEvent.bcs.parse(data));
|
|
6367
|
+
};
|
|
6368
|
+
UpdateRebalanceCostThresholdBpEvent.prototype.toJSONField = function () {
|
|
6369
|
+
return {
|
|
6370
|
+
sender: this.sender,
|
|
6371
|
+
index: this.index.toString(),
|
|
6372
|
+
previousRebalanceCostThresholdBp: this.previousRebalanceCostThresholdBp.toString(),
|
|
6373
|
+
newRebalanceCostThresholdBp: this.newRebalanceCostThresholdBp.toString(),
|
|
6374
|
+
u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
|
|
6375
|
+
};
|
|
6376
|
+
};
|
|
6377
|
+
UpdateRebalanceCostThresholdBpEvent.prototype.toJSON = function () {
|
|
6378
|
+
return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
6379
|
+
};
|
|
6380
|
+
UpdateRebalanceCostThresholdBpEvent.fromJSONField = function (field) {
|
|
6381
|
+
return UpdateRebalanceCostThresholdBpEvent.reified().new({
|
|
6382
|
+
sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
|
|
6383
|
+
index: (0, reified_1.decodeFromJSONField)("u64", field.index),
|
|
6384
|
+
previousRebalanceCostThresholdBp: (0, reified_1.decodeFromJSONField)("u64", field.previousRebalanceCostThresholdBp),
|
|
6385
|
+
newRebalanceCostThresholdBp: (0, reified_1.decodeFromJSONField)("u64", field.newRebalanceCostThresholdBp),
|
|
6386
|
+
u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
|
|
6387
|
+
});
|
|
6388
|
+
};
|
|
6389
|
+
UpdateRebalanceCostThresholdBpEvent.fromJSON = function (json) {
|
|
6390
|
+
if (json.$typeName !== UpdateRebalanceCostThresholdBpEvent.$typeName) {
|
|
6391
|
+
throw new Error("not a WithTwoGenerics json object");
|
|
6392
|
+
}
|
|
6393
|
+
return UpdateRebalanceCostThresholdBpEvent.fromJSONField(json);
|
|
6394
|
+
};
|
|
6395
|
+
UpdateRebalanceCostThresholdBpEvent.fromSuiParsedData = function (content) {
|
|
6396
|
+
if (content.dataType !== "moveObject") {
|
|
6397
|
+
throw new Error("not an object");
|
|
6398
|
+
}
|
|
6399
|
+
if (!isUpdateRebalanceCostThresholdBpEvent(content.type)) {
|
|
6400
|
+
throw new Error("object at ".concat(content.fields.id, " is not a UpdateRebalanceCostThresholdBpEvent object"));
|
|
6401
|
+
}
|
|
6402
|
+
return UpdateRebalanceCostThresholdBpEvent.fromFieldsWithTypes(content);
|
|
6403
|
+
};
|
|
6404
|
+
UpdateRebalanceCostThresholdBpEvent.fromSuiObjectData = function (data) {
|
|
6405
|
+
if (data.bcs) {
|
|
6406
|
+
if (data.bcs.dataType !== "moveObject" || !isUpdateRebalanceCostThresholdBpEvent(data.bcs.type)) {
|
|
6407
|
+
throw new Error("object at is not a UpdateRebalanceCostThresholdBpEvent object");
|
|
6408
|
+
}
|
|
6409
|
+
return UpdateRebalanceCostThresholdBpEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
6410
|
+
}
|
|
6411
|
+
if (data.content) {
|
|
6412
|
+
return UpdateRebalanceCostThresholdBpEvent.fromSuiParsedData(data.content);
|
|
6413
|
+
}
|
|
6414
|
+
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
6415
|
+
};
|
|
6416
|
+
UpdateRebalanceCostThresholdBpEvent.fetch = function (client, id) {
|
|
6417
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
6418
|
+
var res;
|
|
6419
|
+
var _a, _b;
|
|
6420
|
+
return __generator(this, function (_c) {
|
|
6421
|
+
switch (_c.label) {
|
|
6422
|
+
case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
|
|
6423
|
+
case 1:
|
|
6424
|
+
res = _c.sent();
|
|
6425
|
+
if (res.error) {
|
|
6426
|
+
throw new Error("error fetching UpdateRebalanceCostThresholdBpEvent object at id ".concat(id, ": ").concat(res.error.code));
|
|
6427
|
+
}
|
|
6428
|
+
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isUpdateRebalanceCostThresholdBpEvent(res.data.bcs.type)) {
|
|
6429
|
+
throw new Error("object at id ".concat(id, " is not a UpdateRebalanceCostThresholdBpEvent object"));
|
|
6430
|
+
}
|
|
6431
|
+
return [2 /*return*/, UpdateRebalanceCostThresholdBpEvent.fromSuiObjectData(res.data)];
|
|
6432
|
+
}
|
|
6433
|
+
});
|
|
6434
|
+
});
|
|
6435
|
+
};
|
|
6436
|
+
UpdateRebalanceCostThresholdBpEvent.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::UpdateRebalanceCostThresholdBpEvent");
|
|
6437
|
+
UpdateRebalanceCostThresholdBpEvent.$numTypeParams = 0;
|
|
6438
|
+
UpdateRebalanceCostThresholdBpEvent.$isPhantom = [];
|
|
6439
|
+
return UpdateRebalanceCostThresholdBpEvent;
|
|
6440
|
+
}());
|
|
6441
|
+
exports.UpdateRebalanceCostThresholdBpEvent = UpdateRebalanceCostThresholdBpEvent;
|
|
4988
6442
|
/* ============================== UpdateSpotConfigEvent =============================== */
|
|
4989
6443
|
function isUpdateSpotConfigEvent(type) {
|
|
4990
6444
|
type = (0, util_1.compressSuiType)(type);
|