@suilend/sdk 13.8.0-next.gbe76414 → 13.8.0-next.gd305fde
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.
|
@@ -650,7 +650,7 @@ export type ReserveAssetDataEventJSON = {
|
|
|
650
650
|
} & ReserveAssetDataEventJSONField;
|
|
651
651
|
/**
|
|
652
652
|
* Deprecated: this struct's layout is frozen by Sui's upgrade-compatibility check, since
|
|
653
|
-
* it is already published on mainnet. Use `ReserveAssetDataEventV2` instead, which carries
|
|
653
|
+
* it is already published on mainnet. Use `events::suilend_reserve::ReserveAssetDataEventV2` instead, which carries
|
|
654
654
|
* every field here plus `conf` and the unclamped prices.
|
|
655
655
|
*/
|
|
656
656
|
export declare class ReserveAssetDataEvent implements StructClass {
|
|
@@ -698,102 +698,6 @@ export declare class ReserveAssetDataEvent implements StructClass {
|
|
|
698
698
|
}>): ReserveAssetDataEvent;
|
|
699
699
|
static fetch(client: ClientWithCoreApi, id: string): Promise<ReserveAssetDataEvent>;
|
|
700
700
|
}
|
|
701
|
-
export declare function isReserveAssetDataEventV2(type: string): boolean;
|
|
702
|
-
export interface ReserveAssetDataEventV2Fields {
|
|
703
|
-
lendingMarketId: ToField<'address'>;
|
|
704
|
-
coinType: ToField<TypeName>;
|
|
705
|
-
reserveId: ToField<'address'>;
|
|
706
|
-
availableAmount: ToField<Decimal>;
|
|
707
|
-
supplyAmount: ToField<Decimal>;
|
|
708
|
-
borrowedAmount: ToField<Decimal>;
|
|
709
|
-
availableAmountUsdEstimate: ToField<Decimal>;
|
|
710
|
-
supplyAmountUsdEstimate: ToField<Decimal>;
|
|
711
|
-
borrowedAmountUsdEstimate: ToField<Decimal>;
|
|
712
|
-
borrowApr: ToField<Decimal>;
|
|
713
|
-
supplyApr: ToField<Decimal>;
|
|
714
|
-
ctokenSupply: ToField<'u64'>;
|
|
715
|
-
cumulativeBorrowRate: ToField<Decimal>;
|
|
716
|
-
price: ToField<Decimal>;
|
|
717
|
-
smoothedPrice: ToField<Decimal>;
|
|
718
|
-
priceLastUpdateTimestampS: ToField<'u64'>;
|
|
719
|
-
conf: ToField<Decimal>;
|
|
720
|
-
unclampedPrice: ToField<Decimal>;
|
|
721
|
-
unclampedSmoothedPrice: ToField<Decimal>;
|
|
722
|
-
}
|
|
723
|
-
export type ReserveAssetDataEventV2Reified = Reified<ReserveAssetDataEventV2, ReserveAssetDataEventV2Fields>;
|
|
724
|
-
export type ReserveAssetDataEventV2JSONField = {
|
|
725
|
-
lendingMarketId: string;
|
|
726
|
-
coinType: string;
|
|
727
|
-
reserveId: string;
|
|
728
|
-
availableAmount: ToJSON<Decimal>;
|
|
729
|
-
supplyAmount: ToJSON<Decimal>;
|
|
730
|
-
borrowedAmount: ToJSON<Decimal>;
|
|
731
|
-
availableAmountUsdEstimate: ToJSON<Decimal>;
|
|
732
|
-
supplyAmountUsdEstimate: ToJSON<Decimal>;
|
|
733
|
-
borrowedAmountUsdEstimate: ToJSON<Decimal>;
|
|
734
|
-
borrowApr: ToJSON<Decimal>;
|
|
735
|
-
supplyApr: ToJSON<Decimal>;
|
|
736
|
-
ctokenSupply: string;
|
|
737
|
-
cumulativeBorrowRate: ToJSON<Decimal>;
|
|
738
|
-
price: ToJSON<Decimal>;
|
|
739
|
-
smoothedPrice: ToJSON<Decimal>;
|
|
740
|
-
priceLastUpdateTimestampS: string;
|
|
741
|
-
conf: ToJSON<Decimal>;
|
|
742
|
-
unclampedPrice: ToJSON<Decimal>;
|
|
743
|
-
unclampedSmoothedPrice: ToJSON<Decimal>;
|
|
744
|
-
};
|
|
745
|
-
export type ReserveAssetDataEventV2JSON = {
|
|
746
|
-
$typeName: typeof ReserveAssetDataEventV2.$typeName;
|
|
747
|
-
$typeArgs: [];
|
|
748
|
-
} & ReserveAssetDataEventV2JSONField;
|
|
749
|
-
export declare class ReserveAssetDataEventV2 implements StructClass {
|
|
750
|
-
__StructClass: true;
|
|
751
|
-
static get $typeName(): `${string}::reserve::ReserveAssetDataEventV2`;
|
|
752
|
-
static readonly $numTypeParams = 0;
|
|
753
|
-
static readonly $isPhantom: readonly [];
|
|
754
|
-
readonly $typeName: typeof ReserveAssetDataEventV2.$typeName;
|
|
755
|
-
readonly $fullTypeName: `${string}::reserve::ReserveAssetDataEventV2`;
|
|
756
|
-
readonly $typeArgs: [];
|
|
757
|
-
readonly $isPhantom: typeof ReserveAssetDataEventV2.$isPhantom;
|
|
758
|
-
readonly lendingMarketId: ToField<'address'>;
|
|
759
|
-
readonly coinType: ToField<TypeName>;
|
|
760
|
-
readonly reserveId: ToField<'address'>;
|
|
761
|
-
readonly availableAmount: ToField<Decimal>;
|
|
762
|
-
readonly supplyAmount: ToField<Decimal>;
|
|
763
|
-
readonly borrowedAmount: ToField<Decimal>;
|
|
764
|
-
readonly availableAmountUsdEstimate: ToField<Decimal>;
|
|
765
|
-
readonly supplyAmountUsdEstimate: ToField<Decimal>;
|
|
766
|
-
readonly borrowedAmountUsdEstimate: ToField<Decimal>;
|
|
767
|
-
readonly borrowApr: ToField<Decimal>;
|
|
768
|
-
readonly supplyApr: ToField<Decimal>;
|
|
769
|
-
readonly ctokenSupply: ToField<'u64'>;
|
|
770
|
-
readonly cumulativeBorrowRate: ToField<Decimal>;
|
|
771
|
-
readonly price: ToField<Decimal>;
|
|
772
|
-
readonly smoothedPrice: ToField<Decimal>;
|
|
773
|
-
readonly priceLastUpdateTimestampS: ToField<'u64'>;
|
|
774
|
-
readonly conf: ToField<Decimal>;
|
|
775
|
-
readonly unclampedPrice: ToField<Decimal>;
|
|
776
|
-
readonly unclampedSmoothedPrice: ToField<Decimal>;
|
|
777
|
-
private constructor();
|
|
778
|
-
static reified(): ReserveAssetDataEventV2Reified;
|
|
779
|
-
static get r(): ReserveAssetDataEventV2Reified;
|
|
780
|
-
static phantom(): PhantomReified<ToTypeStr<ReserveAssetDataEventV2>>;
|
|
781
|
-
static get p(): PhantomReified<ToTypeStr<ReserveAssetDataEventV2>>;
|
|
782
|
-
private static instantiateBcs;
|
|
783
|
-
private static cachedBcs;
|
|
784
|
-
static get bcs(): ReturnType<typeof ReserveAssetDataEventV2.instantiateBcs>;
|
|
785
|
-
static fromFields(fields: Record<string, any>): ReserveAssetDataEventV2;
|
|
786
|
-
static fromFieldsWithTypes(item: FieldsWithTypes): ReserveAssetDataEventV2;
|
|
787
|
-
static fromBcs(data: Uint8Array): ReserveAssetDataEventV2;
|
|
788
|
-
toJSONField(): ReserveAssetDataEventV2JSONField;
|
|
789
|
-
toJSON(): ReserveAssetDataEventV2JSON;
|
|
790
|
-
static fromJSONField(field: any): ReserveAssetDataEventV2;
|
|
791
|
-
static fromJSON(json: Record<string, any>): ReserveAssetDataEventV2;
|
|
792
|
-
static fromCoreObject(obj: SuiClientTypes.Object<{
|
|
793
|
-
content: true;
|
|
794
|
-
}>): ReserveAssetDataEventV2;
|
|
795
|
-
static fetch(client: ClientWithCoreApi, id: string): Promise<ReserveAssetDataEventV2>;
|
|
796
|
-
}
|
|
797
701
|
export declare function isClaimStakingRewardsEvent(type: string): boolean;
|
|
798
702
|
export interface ClaimStakingRewardsEventFields {
|
|
799
703
|
lendingMarketId: ToField<'address'>;
|
|
@@ -1756,7 +1756,7 @@ export function isReserveAssetDataEvent(type) {
|
|
|
1756
1756
|
}
|
|
1757
1757
|
/**
|
|
1758
1758
|
* Deprecated: this struct's layout is frozen by Sui's upgrade-compatibility check, since
|
|
1759
|
-
* it is already published on mainnet. Use `ReserveAssetDataEventV2` instead, which carries
|
|
1759
|
+
* it is already published on mainnet. Use `events::suilend_reserve::ReserveAssetDataEventV2` instead, which carries
|
|
1760
1760
|
* every field here plus `conf` and the unclamped prices.
|
|
1761
1761
|
*/
|
|
1762
1762
|
export class ReserveAssetDataEvent {
|
|
@@ -1986,260 +1986,6 @@ export class ReserveAssetDataEvent {
|
|
|
1986
1986
|
return ReserveAssetDataEvent.fromBcs(object.content);
|
|
1987
1987
|
}
|
|
1988
1988
|
}
|
|
1989
|
-
/* ============================== ReserveAssetDataEventV2 =============================== */
|
|
1990
|
-
export function isReserveAssetDataEventV2(type) {
|
|
1991
|
-
type = compressSuiType(type);
|
|
1992
|
-
return type
|
|
1993
|
-
=== `${getTypeOrigin('suilend', 'reserve::ReserveAssetDataEventV2')}::reserve::ReserveAssetDataEventV2`;
|
|
1994
|
-
}
|
|
1995
|
-
export class ReserveAssetDataEventV2 {
|
|
1996
|
-
__StructClass = true;
|
|
1997
|
-
static get $typeName() {
|
|
1998
|
-
return `${getTypeOrigin('suilend', 'reserve::ReserveAssetDataEventV2')}::reserve::ReserveAssetDataEventV2`;
|
|
1999
|
-
}
|
|
2000
|
-
static $numTypeParams = 0;
|
|
2001
|
-
static $isPhantom = [];
|
|
2002
|
-
$typeName = ReserveAssetDataEventV2.$typeName;
|
|
2003
|
-
$fullTypeName;
|
|
2004
|
-
$typeArgs;
|
|
2005
|
-
$isPhantom = ReserveAssetDataEventV2.$isPhantom;
|
|
2006
|
-
lendingMarketId;
|
|
2007
|
-
coinType;
|
|
2008
|
-
reserveId;
|
|
2009
|
-
availableAmount;
|
|
2010
|
-
supplyAmount;
|
|
2011
|
-
borrowedAmount;
|
|
2012
|
-
availableAmountUsdEstimate;
|
|
2013
|
-
supplyAmountUsdEstimate;
|
|
2014
|
-
borrowedAmountUsdEstimate;
|
|
2015
|
-
borrowApr;
|
|
2016
|
-
supplyApr;
|
|
2017
|
-
ctokenSupply;
|
|
2018
|
-
cumulativeBorrowRate;
|
|
2019
|
-
price;
|
|
2020
|
-
smoothedPrice;
|
|
2021
|
-
priceLastUpdateTimestampS;
|
|
2022
|
-
conf;
|
|
2023
|
-
unclampedPrice;
|
|
2024
|
-
unclampedSmoothedPrice;
|
|
2025
|
-
constructor(typeArgs, fields) {
|
|
2026
|
-
this.$fullTypeName = composeSuiType(ReserveAssetDataEventV2.$typeName, ...typeArgs);
|
|
2027
|
-
this.$typeArgs = typeArgs;
|
|
2028
|
-
this.lendingMarketId = fields.lendingMarketId;
|
|
2029
|
-
this.coinType = fields.coinType;
|
|
2030
|
-
this.reserveId = fields.reserveId;
|
|
2031
|
-
this.availableAmount = fields.availableAmount;
|
|
2032
|
-
this.supplyAmount = fields.supplyAmount;
|
|
2033
|
-
this.borrowedAmount = fields.borrowedAmount;
|
|
2034
|
-
this.availableAmountUsdEstimate = fields.availableAmountUsdEstimate;
|
|
2035
|
-
this.supplyAmountUsdEstimate = fields.supplyAmountUsdEstimate;
|
|
2036
|
-
this.borrowedAmountUsdEstimate = fields.borrowedAmountUsdEstimate;
|
|
2037
|
-
this.borrowApr = fields.borrowApr;
|
|
2038
|
-
this.supplyApr = fields.supplyApr;
|
|
2039
|
-
this.ctokenSupply = fields.ctokenSupply;
|
|
2040
|
-
this.cumulativeBorrowRate = fields.cumulativeBorrowRate;
|
|
2041
|
-
this.price = fields.price;
|
|
2042
|
-
this.smoothedPrice = fields.smoothedPrice;
|
|
2043
|
-
this.priceLastUpdateTimestampS = fields.priceLastUpdateTimestampS;
|
|
2044
|
-
this.conf = fields.conf;
|
|
2045
|
-
this.unclampedPrice = fields.unclampedPrice;
|
|
2046
|
-
this.unclampedSmoothedPrice = fields.unclampedSmoothedPrice;
|
|
2047
|
-
}
|
|
2048
|
-
static reified() {
|
|
2049
|
-
const reifiedBcs = ReserveAssetDataEventV2.bcs;
|
|
2050
|
-
return {
|
|
2051
|
-
get typeName() {
|
|
2052
|
-
return ReserveAssetDataEventV2.$typeName;
|
|
2053
|
-
},
|
|
2054
|
-
get fullTypeName() {
|
|
2055
|
-
return composeSuiType(ReserveAssetDataEventV2.$typeName, ...[]);
|
|
2056
|
-
},
|
|
2057
|
-
typeArgs: [],
|
|
2058
|
-
isPhantom: ReserveAssetDataEventV2.$isPhantom,
|
|
2059
|
-
reifiedTypeArgs: [],
|
|
2060
|
-
fromFields: (fields) => ReserveAssetDataEventV2.fromFields(fields),
|
|
2061
|
-
fromFieldsWithTypes: (item) => ReserveAssetDataEventV2.fromFieldsWithTypes(item),
|
|
2062
|
-
fromBcs: (data) => ReserveAssetDataEventV2.fromFields(reifiedBcs.parse(data)),
|
|
2063
|
-
bcs: reifiedBcs,
|
|
2064
|
-
fromJSONField: (field) => ReserveAssetDataEventV2.fromJSONField(field),
|
|
2065
|
-
fromJSON: (json) => ReserveAssetDataEventV2.fromJSON(json),
|
|
2066
|
-
fromCoreObject: (obj) => ReserveAssetDataEventV2.fromCoreObject(obj),
|
|
2067
|
-
fetch: async (client, id) => ReserveAssetDataEventV2.fetch(client, id),
|
|
2068
|
-
new: (fields) => {
|
|
2069
|
-
return new ReserveAssetDataEventV2([], fields);
|
|
2070
|
-
},
|
|
2071
|
-
kind: 'StructClassReified',
|
|
2072
|
-
};
|
|
2073
|
-
}
|
|
2074
|
-
static get r() {
|
|
2075
|
-
return ReserveAssetDataEventV2.reified();
|
|
2076
|
-
}
|
|
2077
|
-
static phantom() {
|
|
2078
|
-
return phantom(ReserveAssetDataEventV2.reified());
|
|
2079
|
-
}
|
|
2080
|
-
static get p() {
|
|
2081
|
-
return ReserveAssetDataEventV2.phantom();
|
|
2082
|
-
}
|
|
2083
|
-
static instantiateBcs() {
|
|
2084
|
-
return bcs.struct('ReserveAssetDataEventV2', {
|
|
2085
|
-
lending_market_id: bcs.bytes(32).transform({
|
|
2086
|
-
input: (val) => fromHex(val),
|
|
2087
|
-
output: (val) => toHex(val),
|
|
2088
|
-
}),
|
|
2089
|
-
coin_type: TypeName.bcs,
|
|
2090
|
-
reserve_id: bcs.bytes(32).transform({
|
|
2091
|
-
input: (val) => fromHex(val),
|
|
2092
|
-
output: (val) => toHex(val),
|
|
2093
|
-
}),
|
|
2094
|
-
available_amount: Decimal.bcs,
|
|
2095
|
-
supply_amount: Decimal.bcs,
|
|
2096
|
-
borrowed_amount: Decimal.bcs,
|
|
2097
|
-
available_amount_usd_estimate: Decimal.bcs,
|
|
2098
|
-
supply_amount_usd_estimate: Decimal.bcs,
|
|
2099
|
-
borrowed_amount_usd_estimate: Decimal.bcs,
|
|
2100
|
-
borrow_apr: Decimal.bcs,
|
|
2101
|
-
supply_apr: Decimal.bcs,
|
|
2102
|
-
ctoken_supply: bcs.u64(),
|
|
2103
|
-
cumulative_borrow_rate: Decimal.bcs,
|
|
2104
|
-
price: Decimal.bcs,
|
|
2105
|
-
smoothed_price: Decimal.bcs,
|
|
2106
|
-
price_last_update_timestamp_s: bcs.u64(),
|
|
2107
|
-
conf: Decimal.bcs,
|
|
2108
|
-
unclamped_price: Decimal.bcs,
|
|
2109
|
-
unclamped_smoothed_price: Decimal.bcs,
|
|
2110
|
-
});
|
|
2111
|
-
}
|
|
2112
|
-
static cachedBcs = null;
|
|
2113
|
-
static get bcs() {
|
|
2114
|
-
if (!ReserveAssetDataEventV2.cachedBcs) {
|
|
2115
|
-
ReserveAssetDataEventV2.cachedBcs = ReserveAssetDataEventV2.instantiateBcs();
|
|
2116
|
-
}
|
|
2117
|
-
return ReserveAssetDataEventV2.cachedBcs;
|
|
2118
|
-
}
|
|
2119
|
-
static fromFields(fields) {
|
|
2120
|
-
return ReserveAssetDataEventV2.reified().new({
|
|
2121
|
-
lendingMarketId: decodeFromFields('address', fields.lending_market_id),
|
|
2122
|
-
coinType: decodeFromFields(TypeName.reified(), fields.coin_type),
|
|
2123
|
-
reserveId: decodeFromFields('address', fields.reserve_id),
|
|
2124
|
-
availableAmount: decodeFromFields(Decimal.reified(), fields.available_amount),
|
|
2125
|
-
supplyAmount: decodeFromFields(Decimal.reified(), fields.supply_amount),
|
|
2126
|
-
borrowedAmount: decodeFromFields(Decimal.reified(), fields.borrowed_amount),
|
|
2127
|
-
availableAmountUsdEstimate: decodeFromFields(Decimal.reified(), fields.available_amount_usd_estimate),
|
|
2128
|
-
supplyAmountUsdEstimate: decodeFromFields(Decimal.reified(), fields.supply_amount_usd_estimate),
|
|
2129
|
-
borrowedAmountUsdEstimate: decodeFromFields(Decimal.reified(), fields.borrowed_amount_usd_estimate),
|
|
2130
|
-
borrowApr: decodeFromFields(Decimal.reified(), fields.borrow_apr),
|
|
2131
|
-
supplyApr: decodeFromFields(Decimal.reified(), fields.supply_apr),
|
|
2132
|
-
ctokenSupply: decodeFromFields('u64', fields.ctoken_supply),
|
|
2133
|
-
cumulativeBorrowRate: decodeFromFields(Decimal.reified(), fields.cumulative_borrow_rate),
|
|
2134
|
-
price: decodeFromFields(Decimal.reified(), fields.price),
|
|
2135
|
-
smoothedPrice: decodeFromFields(Decimal.reified(), fields.smoothed_price),
|
|
2136
|
-
priceLastUpdateTimestampS: decodeFromFields('u64', fields.price_last_update_timestamp_s),
|
|
2137
|
-
conf: decodeFromFields(Decimal.reified(), fields.conf),
|
|
2138
|
-
unclampedPrice: decodeFromFields(Decimal.reified(), fields.unclamped_price),
|
|
2139
|
-
unclampedSmoothedPrice: decodeFromFields(Decimal.reified(), fields.unclamped_smoothed_price),
|
|
2140
|
-
});
|
|
2141
|
-
}
|
|
2142
|
-
static fromFieldsWithTypes(item) {
|
|
2143
|
-
if (!isReserveAssetDataEventV2(item.type)) {
|
|
2144
|
-
throw new Error('not a ReserveAssetDataEventV2 type');
|
|
2145
|
-
}
|
|
2146
|
-
return ReserveAssetDataEventV2.reified().new({
|
|
2147
|
-
lendingMarketId: decodeFromFieldsWithTypes('address', item.fields.lending_market_id),
|
|
2148
|
-
coinType: decodeFromFieldsWithTypes(TypeName.reified(), item.fields.coin_type),
|
|
2149
|
-
reserveId: decodeFromFieldsWithTypes('address', item.fields.reserve_id),
|
|
2150
|
-
availableAmount: decodeFromFieldsWithTypes(Decimal.reified(), item.fields.available_amount),
|
|
2151
|
-
supplyAmount: decodeFromFieldsWithTypes(Decimal.reified(), item.fields.supply_amount),
|
|
2152
|
-
borrowedAmount: decodeFromFieldsWithTypes(Decimal.reified(), item.fields.borrowed_amount),
|
|
2153
|
-
availableAmountUsdEstimate: decodeFromFieldsWithTypes(Decimal.reified(), item.fields.available_amount_usd_estimate),
|
|
2154
|
-
supplyAmountUsdEstimate: decodeFromFieldsWithTypes(Decimal.reified(), item.fields.supply_amount_usd_estimate),
|
|
2155
|
-
borrowedAmountUsdEstimate: decodeFromFieldsWithTypes(Decimal.reified(), item.fields.borrowed_amount_usd_estimate),
|
|
2156
|
-
borrowApr: decodeFromFieldsWithTypes(Decimal.reified(), item.fields.borrow_apr),
|
|
2157
|
-
supplyApr: decodeFromFieldsWithTypes(Decimal.reified(), item.fields.supply_apr),
|
|
2158
|
-
ctokenSupply: decodeFromFieldsWithTypes('u64', item.fields.ctoken_supply),
|
|
2159
|
-
cumulativeBorrowRate: decodeFromFieldsWithTypes(Decimal.reified(), item.fields.cumulative_borrow_rate),
|
|
2160
|
-
price: decodeFromFieldsWithTypes(Decimal.reified(), item.fields.price),
|
|
2161
|
-
smoothedPrice: decodeFromFieldsWithTypes(Decimal.reified(), item.fields.smoothed_price),
|
|
2162
|
-
priceLastUpdateTimestampS: decodeFromFieldsWithTypes('u64', item.fields.price_last_update_timestamp_s),
|
|
2163
|
-
conf: decodeFromFieldsWithTypes(Decimal.reified(), item.fields.conf),
|
|
2164
|
-
unclampedPrice: decodeFromFieldsWithTypes(Decimal.reified(), item.fields.unclamped_price),
|
|
2165
|
-
unclampedSmoothedPrice: decodeFromFieldsWithTypes(Decimal.reified(), item.fields.unclamped_smoothed_price),
|
|
2166
|
-
});
|
|
2167
|
-
}
|
|
2168
|
-
static fromBcs(data) {
|
|
2169
|
-
return ReserveAssetDataEventV2.fromFields(ReserveAssetDataEventV2.bcs.parse(data));
|
|
2170
|
-
}
|
|
2171
|
-
toJSONField() {
|
|
2172
|
-
return {
|
|
2173
|
-
lendingMarketId: this.lendingMarketId,
|
|
2174
|
-
coinType: this.coinType,
|
|
2175
|
-
reserveId: this.reserveId,
|
|
2176
|
-
availableAmount: this.availableAmount.toJSONField(),
|
|
2177
|
-
supplyAmount: this.supplyAmount.toJSONField(),
|
|
2178
|
-
borrowedAmount: this.borrowedAmount.toJSONField(),
|
|
2179
|
-
availableAmountUsdEstimate: this.availableAmountUsdEstimate.toJSONField(),
|
|
2180
|
-
supplyAmountUsdEstimate: this.supplyAmountUsdEstimate.toJSONField(),
|
|
2181
|
-
borrowedAmountUsdEstimate: this.borrowedAmountUsdEstimate.toJSONField(),
|
|
2182
|
-
borrowApr: this.borrowApr.toJSONField(),
|
|
2183
|
-
supplyApr: this.supplyApr.toJSONField(),
|
|
2184
|
-
ctokenSupply: this.ctokenSupply.toString(),
|
|
2185
|
-
cumulativeBorrowRate: this.cumulativeBorrowRate.toJSONField(),
|
|
2186
|
-
price: this.price.toJSONField(),
|
|
2187
|
-
smoothedPrice: this.smoothedPrice.toJSONField(),
|
|
2188
|
-
priceLastUpdateTimestampS: this.priceLastUpdateTimestampS.toString(),
|
|
2189
|
-
conf: this.conf.toJSONField(),
|
|
2190
|
-
unclampedPrice: this.unclampedPrice.toJSONField(),
|
|
2191
|
-
unclampedSmoothedPrice: this.unclampedSmoothedPrice.toJSONField(),
|
|
2192
|
-
};
|
|
2193
|
-
}
|
|
2194
|
-
toJSON() {
|
|
2195
|
-
return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() };
|
|
2196
|
-
}
|
|
2197
|
-
static fromJSONField(field) {
|
|
2198
|
-
return ReserveAssetDataEventV2.reified().new({
|
|
2199
|
-
lendingMarketId: decodeFromJSONField('address', field.lendingMarketId),
|
|
2200
|
-
coinType: decodeFromJSONField(TypeName.reified(), field.coinType),
|
|
2201
|
-
reserveId: decodeFromJSONField('address', field.reserveId),
|
|
2202
|
-
availableAmount: decodeFromJSONField(Decimal.reified(), field.availableAmount),
|
|
2203
|
-
supplyAmount: decodeFromJSONField(Decimal.reified(), field.supplyAmount),
|
|
2204
|
-
borrowedAmount: decodeFromJSONField(Decimal.reified(), field.borrowedAmount),
|
|
2205
|
-
availableAmountUsdEstimate: decodeFromJSONField(Decimal.reified(), field.availableAmountUsdEstimate),
|
|
2206
|
-
supplyAmountUsdEstimate: decodeFromJSONField(Decimal.reified(), field.supplyAmountUsdEstimate),
|
|
2207
|
-
borrowedAmountUsdEstimate: decodeFromJSONField(Decimal.reified(), field.borrowedAmountUsdEstimate),
|
|
2208
|
-
borrowApr: decodeFromJSONField(Decimal.reified(), field.borrowApr),
|
|
2209
|
-
supplyApr: decodeFromJSONField(Decimal.reified(), field.supplyApr),
|
|
2210
|
-
ctokenSupply: decodeFromJSONField('u64', field.ctokenSupply),
|
|
2211
|
-
cumulativeBorrowRate: decodeFromJSONField(Decimal.reified(), field.cumulativeBorrowRate),
|
|
2212
|
-
price: decodeFromJSONField(Decimal.reified(), field.price),
|
|
2213
|
-
smoothedPrice: decodeFromJSONField(Decimal.reified(), field.smoothedPrice),
|
|
2214
|
-
priceLastUpdateTimestampS: decodeFromJSONField('u64', field.priceLastUpdateTimestampS),
|
|
2215
|
-
conf: decodeFromJSONField(Decimal.reified(), field.conf),
|
|
2216
|
-
unclampedPrice: decodeFromJSONField(Decimal.reified(), field.unclampedPrice),
|
|
2217
|
-
unclampedSmoothedPrice: decodeFromJSONField(Decimal.reified(), field.unclampedSmoothedPrice),
|
|
2218
|
-
});
|
|
2219
|
-
}
|
|
2220
|
-
static fromJSON(json) {
|
|
2221
|
-
if (json.$typeName !== ReserveAssetDataEventV2.$typeName) {
|
|
2222
|
-
throw new Error(`not a ReserveAssetDataEventV2 json object: expected '${ReserveAssetDataEventV2.$typeName}' but got '${json.$typeName}'`);
|
|
2223
|
-
}
|
|
2224
|
-
return ReserveAssetDataEventV2.fromJSONField(json);
|
|
2225
|
-
}
|
|
2226
|
-
static fromCoreObject(obj) {
|
|
2227
|
-
if (!isReserveAssetDataEventV2(obj.type)) {
|
|
2228
|
-
throw new Error(`object at ${obj.objectId} is not a ReserveAssetDataEventV2 object`);
|
|
2229
|
-
}
|
|
2230
|
-
return ReserveAssetDataEventV2.fromBcs(obj.content);
|
|
2231
|
-
}
|
|
2232
|
-
static async fetch(client, id) {
|
|
2233
|
-
const { object } = await client.core.getObject({
|
|
2234
|
-
objectId: id,
|
|
2235
|
-
include: { content: true },
|
|
2236
|
-
});
|
|
2237
|
-
if (!isReserveAssetDataEventV2(object.type)) {
|
|
2238
|
-
throw new Error(`object at id ${id} is not a ReserveAssetDataEventV2 object`);
|
|
2239
|
-
}
|
|
2240
|
-
return ReserveAssetDataEventV2.fromBcs(object.content);
|
|
2241
|
-
}
|
|
2242
|
-
}
|
|
2243
1989
|
/* ============================== ClaimStakingRewardsEvent =============================== */
|
|
2244
1990
|
export function isClaimStakingRewardsEvent(type) {
|
|
2245
1991
|
type = compressSuiType(type);
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@suilend/sdk","version":"13.8.0-next.
|
|
1
|
+
{"name":"@suilend/sdk","version":"13.8.0-next.gd305fde","private":false,"description":"A TypeScript SDK for interacting with the Suilend program","author":"Suilend","license":"MIT","main":"./index.js","exports":{".":"./index.js","./client":"./client.js","./mmt":"./mmt.js","./strategies":"./strategies.js","./api/events":"./api/events.js","./api":"./api/index.js","./lib/constants":"./lib/constants.js","./lib":"./lib/index.js","./lib/initialize":"./lib/initialize.js","./lib/liquidityMining":"./lib/liquidityMining.js","./lib/proCompatible":"./lib/proCompatible.js","./lib/pyth":"./lib/pyth.js","./lib/strategyOwnerCap":"./lib/strategyOwnerCap.js","./lib/transactions":"./lib/transactions.js","./lib/types":"./lib/types.js","./margin":"./margin/index.js","./parsers/apiReserveAssetDataEvent":"./parsers/apiReserveAssetDataEvent.js","./parsers":"./parsers/index.js","./parsers/lendingMarket":"./parsers/lendingMarket.js","./parsers/obligation":"./parsers/obligation.js","./parsers/rateLimiter":"./parsers/rateLimiter.js","./parsers/reserve":"./parsers/reserve.js","./swap":"./swap/index.js","./swap/quote":"./swap/quote.js","./swap/transaction":"./swap/transaction.js","./utils/events":"./utils/events.js","./utils/feedId":"./utils/feedId.js","./utils":"./utils/index.js","./utils/interpolate":"./utils/interpolate.js","./utils/obligation":"./utils/obligation.js","./utils/priceGuard":"./utils/priceGuard.js","./utils/simulate":"./utils/simulate.js","./_generated/_envs":"./_generated/_envs/index.js","./_generated/_envs/mainnet":"./_generated/_envs/mainnet.js","./_generated/_framework/env":"./_generated/_framework/env.js","./_generated/_framework/reified":"./_generated/_framework/reified.js","./_generated/_framework/util":"./_generated/_framework/util.js","./_generated/_framework/vector":"./_generated/_framework/vector.js","./_generated/suilend":"./_generated/suilend/index.js","./margin/margin/admin_cap":"./margin/margin/admin_cap.js","./margin/margin/market":"./margin/margin/market.js","./margin/margin/permissions":"./margin/margin/permissions.js","./margin/margin/position":"./margin/margin/position.js","./margin/margin/router":"./margin/margin/router.js","./margin/margin/version":"./margin/margin/version.js","./margin/utils":"./margin/utils/index.js","./_generated/suilend/cell/structs":"./_generated/suilend/cell/structs.js","./_generated/suilend/decimal/structs":"./_generated/suilend/decimal/structs.js","./_generated/suilend/lending-market/functions":"./_generated/suilend/lending-market/functions.js","./_generated/suilend/lending-market/structs":"./_generated/suilend/lending-market/structs.js","./_generated/suilend/lending-market-registry/functions":"./_generated/suilend/lending-market-registry/functions.js","./_generated/suilend/liquidity-mining/structs":"./_generated/suilend/liquidity-mining/structs.js","./_generated/suilend/obligation/structs":"./_generated/suilend/obligation/structs.js","./_generated/suilend/rate-limiter/functions":"./_generated/suilend/rate-limiter/functions.js","./_generated/suilend/rate-limiter/structs":"./_generated/suilend/rate-limiter/structs.js","./_generated/suilend/reserve/structs":"./_generated/suilend/reserve/structs.js","./_generated/suilend/reserve-config/functions":"./_generated/suilend/reserve-config/functions.js","./_generated/suilend/reserve-config/structs":"./_generated/suilend/reserve-config/structs.js","./_generated/_dependencies/pyth-2/price-identifier/structs":"./_generated/_dependencies/pyth-2/price-identifier/structs.js","./_generated/_dependencies/std/ascii/structs":"./_generated/_dependencies/std/ascii/structs.js","./_generated/_dependencies/std/option/structs":"./_generated/_dependencies/std/option/structs.js","./_generated/_dependencies/std/type-name/structs":"./_generated/_dependencies/std/type-name/structs.js","./_generated/_dependencies/sui/bag/structs":"./_generated/_dependencies/sui/bag/structs.js","./_generated/_dependencies/sui/balance/structs":"./_generated/_dependencies/sui/balance/structs.js","./_generated/_dependencies/sui/object/structs":"./_generated/_dependencies/sui/object/structs.js","./_generated/_dependencies/sui/object-table/structs":"./_generated/_dependencies/sui/object-table/structs.js","./margin/margin/deps/std/type_name":"./margin/margin/deps/std/type_name.js","./margin/margin/deps/sui/vec_set":"./margin/margin/deps/sui/vec_set.js","./margin/margin/deps/suilend/lending_market":"./margin/margin/deps/suilend/lending_market.js"},"types":"./index.d.ts","scripts":{"codegen":"node ./codegen.js","codegen:install":"node ./install-codegen.js","build":"rm -rf ./dist && tsc && node ./fix-esm-imports.js","typecheck":"tsc --noEmit && tsc --noEmit -p tsconfig.test.json","test":"vitest run","lint:ci":"yarn run typecheck","prettier":"prettier --write src/ tests/","release":"yarn run build && node ./release.js && cd ./dist && npm publish --access public"},"repository":{"type":"git","url":"git+https://github.com/fireflyprotocol/lending-mono.git","directory":"ts/sdks/sdk"},"dependencies":{"@bluefin-exchange/bluefin7k-aggregator-sdk":"7.7.0","@cetusprotocol/aggregator-sdk":"1.7.3","@flowx-finance/sdk":"2.1.0","@pythnetwork/hermes-client":"3.1.0","@pythnetwork/pyth-sui-js":"4.0.0","@suilend/springsui-sdk":"4.1.0","bignumber.js":"11.1.5","bn.js":"5.2.5","crypto-js":"4.2.0","lodash":"4.18.1","p-limit":"7.3.3","uuid":"14.0.2"},"devDependencies":{"@mysten/bcs":"2.1.2","@mysten/sui":"2.35.0","@suilend/sui-core":"2.2.0","@tsconfig/recommended":"1.0.13","@types/bn.js":"5.2.0","@types/lodash":"4.17.26","@types/node":"26.6.5","fast-check":"4.10.2","prettier":"3.9.10","ts-node":"10.9.2","typescript":"6.0.3","vite":"8.3.4","vitest":"5.0.4"},"peerDependencies":{"@mysten/bcs":"^2.1.1","@mysten/sui":">=2.31.3 <3","@suilend/sui-core":"^2.0.1"},"type":"module"}
|