@suilend/sdk 1.1.21 → 1.1.23
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/_generated/_dependencies/source/0x1/ascii/structs.js +3 -3
- package/_generated/_dependencies/source/0x1/option/structs.d.ts +1 -1
- package/_generated/_dependencies/source/0x1/option/structs.js +2 -2
- package/_generated/_dependencies/source/0x1/type-name/structs.js +2 -2
- package/_generated/_dependencies/source/0x2/bag/structs.js +2 -2
- package/_generated/_dependencies/source/0x2/balance/structs.js +3 -3
- package/_generated/_dependencies/source/0x2/object/structs.js +3 -3
- package/_generated/_dependencies/source/0x2/object-table/structs.js +2 -2
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/i64/structs.d.ts +52 -0
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/i64/structs.js +148 -0
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price/structs.d.ts +89 -0
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price/structs.js +162 -0
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-feed/structs.d.ts +158 -0
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-feed/structs.js +157 -0
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-identifier/structs.js +2 -2
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-info/structs.d.ts +360 -0
- package/_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-info/structs.js +290 -0
- package/_generated/_framework/reified.js +10 -10
- package/_generated/_framework/util.d.ts +5 -11
- package/_generated/_framework/util.js +12 -13
- package/_generated/_framework/vector.d.ts +1 -1
- package/_generated/_framework/vector.js +2 -2
- package/_generated/suilend/cell/structs.d.ts +1 -1
- package/_generated/suilend/cell/structs.js +2 -2
- package/_generated/suilend/decimal/structs.js +2 -2
- package/_generated/suilend/index.js +2 -2
- package/_generated/suilend/lending-market/functions.js +40 -41
- package/_generated/suilend/lending-market/structs.js +15 -15
- package/_generated/suilend/lending-market-registry/functions.js +2 -3
- package/_generated/suilend/liquidity-mining/structs.js +6 -6
- package/_generated/suilend/obligation/structs.js +7 -7
- package/_generated/suilend/rate-limiter/functions.js +6 -7
- package/_generated/suilend/rate-limiter/structs.js +3 -3
- package/_generated/suilend/reserve/structs.js +10 -10
- package/_generated/suilend/reserve-config/functions.js +39 -40
- package/_generated/suilend/reserve-config/structs.js +3 -3
- package/client.d.ts +11 -9
- package/client.js +86 -83
- package/package.json +1 -1
- package/parsers/lendingMarket.d.ts +2 -2
- package/parsers/obligation.d.ts +4 -4
- package/parsers/reserve.d.ts +2 -2
- package/utils/events.js +3 -3
- package/utils/index.js +10 -2
- package/utils/obligation.js +5 -6
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { PhantomReified, Reified, StructClass, ToField, ToTypeStr } from "../../../../_framework/reified";
|
|
2
|
+
import { FieldsWithTypes } from "../../../../_framework/util";
|
|
3
|
+
import { PKG_V1 } from "../index";
|
|
4
|
+
import { PriceIdentifier } from "../price-identifier/structs";
|
|
5
|
+
import { Price } from "../price/structs";
|
|
6
|
+
import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
|
|
7
|
+
export declare function isPriceFeed(type: string): boolean;
|
|
8
|
+
export interface PriceFeedFields {
|
|
9
|
+
priceIdentifier: ToField<PriceIdentifier>;
|
|
10
|
+
price: ToField<Price>;
|
|
11
|
+
emaPrice: ToField<Price>;
|
|
12
|
+
}
|
|
13
|
+
export type PriceFeedReified = Reified<PriceFeed, PriceFeedFields>;
|
|
14
|
+
export declare class PriceFeed implements StructClass {
|
|
15
|
+
__StructClass: true;
|
|
16
|
+
static readonly $typeName = "0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e::price_feed::PriceFeed";
|
|
17
|
+
static readonly $numTypeParams = 0;
|
|
18
|
+
static readonly $isPhantom: readonly [];
|
|
19
|
+
readonly $typeName = "0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e::price_feed::PriceFeed";
|
|
20
|
+
readonly $fullTypeName: `${typeof PKG_V1}::price_feed::PriceFeed`;
|
|
21
|
+
readonly $typeArgs: [];
|
|
22
|
+
readonly $isPhantom: readonly [];
|
|
23
|
+
readonly priceIdentifier: ToField<PriceIdentifier>;
|
|
24
|
+
readonly price: ToField<Price>;
|
|
25
|
+
readonly emaPrice: ToField<Price>;
|
|
26
|
+
private constructor();
|
|
27
|
+
static reified(): PriceFeedReified;
|
|
28
|
+
static get r(): import("../../../../_framework/reified").StructClassReified<PriceFeed, PriceFeedFields>;
|
|
29
|
+
static phantom(): PhantomReified<ToTypeStr<PriceFeed>>;
|
|
30
|
+
static get p(): PhantomReified<"0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e::price_feed::PriceFeed">;
|
|
31
|
+
static get bcs(): import("@mysten/sui/bcs").BcsType<{
|
|
32
|
+
price_identifier: {
|
|
33
|
+
bytes: number[];
|
|
34
|
+
};
|
|
35
|
+
price: {
|
|
36
|
+
price: {
|
|
37
|
+
negative: boolean;
|
|
38
|
+
magnitude: string;
|
|
39
|
+
};
|
|
40
|
+
conf: string;
|
|
41
|
+
expo: {
|
|
42
|
+
negative: boolean;
|
|
43
|
+
magnitude: string;
|
|
44
|
+
};
|
|
45
|
+
timestamp: string;
|
|
46
|
+
};
|
|
47
|
+
ema_price: {
|
|
48
|
+
price: {
|
|
49
|
+
negative: boolean;
|
|
50
|
+
magnitude: string;
|
|
51
|
+
};
|
|
52
|
+
conf: string;
|
|
53
|
+
expo: {
|
|
54
|
+
negative: boolean;
|
|
55
|
+
magnitude: string;
|
|
56
|
+
};
|
|
57
|
+
timestamp: string;
|
|
58
|
+
};
|
|
59
|
+
}, {
|
|
60
|
+
price_identifier: {
|
|
61
|
+
bytes: Iterable<number> & {
|
|
62
|
+
length: number;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
price: {
|
|
66
|
+
price: {
|
|
67
|
+
negative: boolean;
|
|
68
|
+
magnitude: string | number | bigint;
|
|
69
|
+
};
|
|
70
|
+
conf: string | number | bigint;
|
|
71
|
+
expo: {
|
|
72
|
+
negative: boolean;
|
|
73
|
+
magnitude: string | number | bigint;
|
|
74
|
+
};
|
|
75
|
+
timestamp: string | number | bigint;
|
|
76
|
+
};
|
|
77
|
+
ema_price: {
|
|
78
|
+
price: {
|
|
79
|
+
negative: boolean;
|
|
80
|
+
magnitude: string | number | bigint;
|
|
81
|
+
};
|
|
82
|
+
conf: string | number | bigint;
|
|
83
|
+
expo: {
|
|
84
|
+
negative: boolean;
|
|
85
|
+
magnitude: string | number | bigint;
|
|
86
|
+
};
|
|
87
|
+
timestamp: string | number | bigint;
|
|
88
|
+
};
|
|
89
|
+
}>;
|
|
90
|
+
static fromFields(fields: Record<string, any>): PriceFeed;
|
|
91
|
+
static fromFieldsWithTypes(item: FieldsWithTypes): PriceFeed;
|
|
92
|
+
static fromBcs(data: Uint8Array): PriceFeed;
|
|
93
|
+
toJSONField(): {
|
|
94
|
+
priceIdentifier: {
|
|
95
|
+
bytes: number[];
|
|
96
|
+
};
|
|
97
|
+
price: {
|
|
98
|
+
price: {
|
|
99
|
+
negative: boolean;
|
|
100
|
+
magnitude: string;
|
|
101
|
+
};
|
|
102
|
+
conf: string;
|
|
103
|
+
expo: {
|
|
104
|
+
negative: boolean;
|
|
105
|
+
magnitude: string;
|
|
106
|
+
};
|
|
107
|
+
timestamp: string;
|
|
108
|
+
};
|
|
109
|
+
emaPrice: {
|
|
110
|
+
price: {
|
|
111
|
+
negative: boolean;
|
|
112
|
+
magnitude: string;
|
|
113
|
+
};
|
|
114
|
+
conf: string;
|
|
115
|
+
expo: {
|
|
116
|
+
negative: boolean;
|
|
117
|
+
magnitude: string;
|
|
118
|
+
};
|
|
119
|
+
timestamp: string;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
toJSON(): {
|
|
123
|
+
priceIdentifier: {
|
|
124
|
+
bytes: number[];
|
|
125
|
+
};
|
|
126
|
+
price: {
|
|
127
|
+
price: {
|
|
128
|
+
negative: boolean;
|
|
129
|
+
magnitude: string;
|
|
130
|
+
};
|
|
131
|
+
conf: string;
|
|
132
|
+
expo: {
|
|
133
|
+
negative: boolean;
|
|
134
|
+
magnitude: string;
|
|
135
|
+
};
|
|
136
|
+
timestamp: string;
|
|
137
|
+
};
|
|
138
|
+
emaPrice: {
|
|
139
|
+
price: {
|
|
140
|
+
negative: boolean;
|
|
141
|
+
magnitude: string;
|
|
142
|
+
};
|
|
143
|
+
conf: string;
|
|
144
|
+
expo: {
|
|
145
|
+
negative: boolean;
|
|
146
|
+
magnitude: string;
|
|
147
|
+
};
|
|
148
|
+
timestamp: string;
|
|
149
|
+
};
|
|
150
|
+
$typeName: string;
|
|
151
|
+
$typeArgs: [];
|
|
152
|
+
};
|
|
153
|
+
static fromJSONField(field: any): PriceFeed;
|
|
154
|
+
static fromJSON(json: Record<string, any>): PriceFeed;
|
|
155
|
+
static fromSuiParsedData(content: SuiParsedData): PriceFeed;
|
|
156
|
+
static fromSuiObjectData(data: SuiObjectData): PriceFeed;
|
|
157
|
+
static fetch(client: SuiClient, id: string): Promise<PriceFeed>;
|
|
158
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PriceFeed = void 0;
|
|
13
|
+
exports.isPriceFeed = isPriceFeed;
|
|
14
|
+
const reified_1 = require("../../../../_framework/reified");
|
|
15
|
+
const util_1 = require("../../../../_framework/util");
|
|
16
|
+
const index_1 = require("../index");
|
|
17
|
+
const structs_1 = require("../price-identifier/structs");
|
|
18
|
+
const structs_2 = require("../price/structs");
|
|
19
|
+
const bcs_1 = require("@mysten/sui/bcs");
|
|
20
|
+
const utils_1 = require("@mysten/sui/utils");
|
|
21
|
+
/* ============================== PriceFeed =============================== */
|
|
22
|
+
function isPriceFeed(type) {
|
|
23
|
+
type = (0, util_1.compressSuiType)(type);
|
|
24
|
+
return type === `${index_1.PKG_V1}::price_feed::PriceFeed`;
|
|
25
|
+
}
|
|
26
|
+
class PriceFeed {
|
|
27
|
+
constructor(typeArgs, fields) {
|
|
28
|
+
this.__StructClass = true;
|
|
29
|
+
this.$typeName = PriceFeed.$typeName;
|
|
30
|
+
this.$isPhantom = PriceFeed.$isPhantom;
|
|
31
|
+
this.$fullTypeName = (0, util_1.composeSuiType)(PriceFeed.$typeName, ...typeArgs);
|
|
32
|
+
this.$typeArgs = typeArgs;
|
|
33
|
+
this.priceIdentifier = fields.priceIdentifier;
|
|
34
|
+
this.price = fields.price;
|
|
35
|
+
this.emaPrice = fields.emaPrice;
|
|
36
|
+
}
|
|
37
|
+
static reified() {
|
|
38
|
+
return {
|
|
39
|
+
typeName: PriceFeed.$typeName,
|
|
40
|
+
fullTypeName: (0, util_1.composeSuiType)(PriceFeed.$typeName, ...[]),
|
|
41
|
+
typeArgs: [],
|
|
42
|
+
isPhantom: PriceFeed.$isPhantom,
|
|
43
|
+
reifiedTypeArgs: [],
|
|
44
|
+
fromFields: (fields) => PriceFeed.fromFields(fields),
|
|
45
|
+
fromFieldsWithTypes: (item) => PriceFeed.fromFieldsWithTypes(item),
|
|
46
|
+
fromBcs: (data) => PriceFeed.fromBcs(data),
|
|
47
|
+
bcs: PriceFeed.bcs,
|
|
48
|
+
fromJSONField: (field) => PriceFeed.fromJSONField(field),
|
|
49
|
+
fromJSON: (json) => PriceFeed.fromJSON(json),
|
|
50
|
+
fromSuiParsedData: (content) => PriceFeed.fromSuiParsedData(content),
|
|
51
|
+
fromSuiObjectData: (content) => PriceFeed.fromSuiObjectData(content),
|
|
52
|
+
fetch: (client, id) => __awaiter(this, void 0, void 0, function* () { return PriceFeed.fetch(client, id); }),
|
|
53
|
+
new: (fields) => {
|
|
54
|
+
return new PriceFeed([], fields);
|
|
55
|
+
},
|
|
56
|
+
kind: "StructClassReified",
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
static get r() {
|
|
60
|
+
return PriceFeed.reified();
|
|
61
|
+
}
|
|
62
|
+
static phantom() {
|
|
63
|
+
return (0, reified_1.phantom)(PriceFeed.reified());
|
|
64
|
+
}
|
|
65
|
+
static get p() {
|
|
66
|
+
return PriceFeed.phantom();
|
|
67
|
+
}
|
|
68
|
+
static get bcs() {
|
|
69
|
+
return bcs_1.bcs.struct("PriceFeed", {
|
|
70
|
+
price_identifier: structs_1.PriceIdentifier.bcs,
|
|
71
|
+
price: structs_2.Price.bcs,
|
|
72
|
+
ema_price: structs_2.Price.bcs,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
static fromFields(fields) {
|
|
76
|
+
return PriceFeed.reified().new({
|
|
77
|
+
priceIdentifier: (0, reified_1.decodeFromFields)(structs_1.PriceIdentifier.reified(), fields.price_identifier),
|
|
78
|
+
price: (0, reified_1.decodeFromFields)(structs_2.Price.reified(), fields.price),
|
|
79
|
+
emaPrice: (0, reified_1.decodeFromFields)(structs_2.Price.reified(), fields.ema_price),
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
static fromFieldsWithTypes(item) {
|
|
83
|
+
if (!isPriceFeed(item.type)) {
|
|
84
|
+
throw new Error("not a PriceFeed type");
|
|
85
|
+
}
|
|
86
|
+
return PriceFeed.reified().new({
|
|
87
|
+
priceIdentifier: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.PriceIdentifier.reified(), item.fields.price_identifier),
|
|
88
|
+
price: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.Price.reified(), item.fields.price),
|
|
89
|
+
emaPrice: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.Price.reified(), item.fields.ema_price),
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
static fromBcs(data) {
|
|
93
|
+
return PriceFeed.fromFields(PriceFeed.bcs.parse(data));
|
|
94
|
+
}
|
|
95
|
+
toJSONField() {
|
|
96
|
+
return {
|
|
97
|
+
priceIdentifier: this.priceIdentifier.toJSONField(),
|
|
98
|
+
price: this.price.toJSONField(),
|
|
99
|
+
emaPrice: this.emaPrice.toJSONField(),
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
toJSON() {
|
|
103
|
+
return Object.assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
|
|
104
|
+
}
|
|
105
|
+
static fromJSONField(field) {
|
|
106
|
+
return PriceFeed.reified().new({
|
|
107
|
+
priceIdentifier: (0, reified_1.decodeFromJSONField)(structs_1.PriceIdentifier.reified(), field.priceIdentifier),
|
|
108
|
+
price: (0, reified_1.decodeFromJSONField)(structs_2.Price.reified(), field.price),
|
|
109
|
+
emaPrice: (0, reified_1.decodeFromJSONField)(structs_2.Price.reified(), field.emaPrice),
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
static fromJSON(json) {
|
|
113
|
+
if (json.$typeName !== PriceFeed.$typeName) {
|
|
114
|
+
throw new Error("not a WithTwoGenerics json object");
|
|
115
|
+
}
|
|
116
|
+
return PriceFeed.fromJSONField(json);
|
|
117
|
+
}
|
|
118
|
+
static fromSuiParsedData(content) {
|
|
119
|
+
if (content.dataType !== "moveObject") {
|
|
120
|
+
throw new Error("not an object");
|
|
121
|
+
}
|
|
122
|
+
if (!isPriceFeed(content.type)) {
|
|
123
|
+
throw new Error(`object at ${content.fields.id} is not a PriceFeed object`);
|
|
124
|
+
}
|
|
125
|
+
return PriceFeed.fromFieldsWithTypes(content);
|
|
126
|
+
}
|
|
127
|
+
static fromSuiObjectData(data) {
|
|
128
|
+
if (data.bcs) {
|
|
129
|
+
if (data.bcs.dataType !== "moveObject" || !isPriceFeed(data.bcs.type)) {
|
|
130
|
+
throw new Error(`object at is not a PriceFeed object`);
|
|
131
|
+
}
|
|
132
|
+
return PriceFeed.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
|
|
133
|
+
}
|
|
134
|
+
if (data.content) {
|
|
135
|
+
return PriceFeed.fromSuiParsedData(data.content);
|
|
136
|
+
}
|
|
137
|
+
throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
|
|
138
|
+
}
|
|
139
|
+
static fetch(client, id) {
|
|
140
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
141
|
+
var _a, _b;
|
|
142
|
+
const res = yield client.getObject({ id, options: { showBcs: true } });
|
|
143
|
+
if (res.error) {
|
|
144
|
+
throw new Error(`error fetching PriceFeed object at id ${id}: ${res.error.code}`);
|
|
145
|
+
}
|
|
146
|
+
if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" ||
|
|
147
|
+
!isPriceFeed(res.data.bcs.type)) {
|
|
148
|
+
throw new Error(`object at id ${id} is not a PriceFeed object`);
|
|
149
|
+
}
|
|
150
|
+
return PriceFeed.fromSuiObjectData(res.data);
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
exports.PriceFeed = PriceFeed;
|
|
155
|
+
PriceFeed.$typeName = `${index_1.PKG_V1}::price_feed::PriceFeed`;
|
|
156
|
+
PriceFeed.$numTypeParams = 0;
|
|
157
|
+
PriceFeed.$isPhantom = [];
|
|
@@ -32,7 +32,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.PriceIdentifier =
|
|
35
|
+
exports.PriceIdentifier = void 0;
|
|
36
|
+
exports.isPriceIdentifier = isPriceIdentifier;
|
|
36
37
|
const reified = __importStar(require("../../../../_framework/reified"));
|
|
37
38
|
const reified_1 = require("../../../../_framework/reified");
|
|
38
39
|
const util_1 = require("../../../../_framework/util");
|
|
@@ -44,7 +45,6 @@ function isPriceIdentifier(type) {
|
|
|
44
45
|
type = (0, util_1.compressSuiType)(type);
|
|
45
46
|
return type === `${index_1.PKG_V1}::price_identifier::PriceIdentifier`;
|
|
46
47
|
}
|
|
47
|
-
exports.isPriceIdentifier = isPriceIdentifier;
|
|
48
48
|
class PriceIdentifier {
|
|
49
49
|
constructor(typeArgs, fields) {
|
|
50
50
|
this.__StructClass = true;
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
import { PhantomReified, Reified, StructClass, ToField, ToTypeStr } from "../../../../_framework/reified";
|
|
2
|
+
import { FieldsWithTypes } from "../../../../_framework/util";
|
|
3
|
+
import { UID } from "../../0x2/object/structs";
|
|
4
|
+
import { PKG_V1 } from "../index";
|
|
5
|
+
import { PriceFeed } from "../price-feed/structs";
|
|
6
|
+
import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
|
|
7
|
+
export declare function isPriceInfo(type: string): boolean;
|
|
8
|
+
export interface PriceInfoFields {
|
|
9
|
+
attestationTime: ToField<"u64">;
|
|
10
|
+
arrivalTime: ToField<"u64">;
|
|
11
|
+
priceFeed: ToField<PriceFeed>;
|
|
12
|
+
}
|
|
13
|
+
export type PriceInfoReified = Reified<PriceInfo, PriceInfoFields>;
|
|
14
|
+
export declare class PriceInfo implements StructClass {
|
|
15
|
+
__StructClass: true;
|
|
16
|
+
static readonly $typeName = "0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e::price_info::PriceInfo";
|
|
17
|
+
static readonly $numTypeParams = 0;
|
|
18
|
+
static readonly $isPhantom: readonly [];
|
|
19
|
+
readonly $typeName = "0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e::price_info::PriceInfo";
|
|
20
|
+
readonly $fullTypeName: `${typeof PKG_V1}::price_info::PriceInfo`;
|
|
21
|
+
readonly $typeArgs: [];
|
|
22
|
+
readonly $isPhantom: readonly [];
|
|
23
|
+
readonly attestationTime: ToField<"u64">;
|
|
24
|
+
readonly arrivalTime: ToField<"u64">;
|
|
25
|
+
readonly priceFeed: ToField<PriceFeed>;
|
|
26
|
+
private constructor();
|
|
27
|
+
static reified(): PriceInfoReified;
|
|
28
|
+
static get r(): import("../../../../_framework/reified").StructClassReified<PriceInfo, PriceInfoFields>;
|
|
29
|
+
static phantom(): PhantomReified<ToTypeStr<PriceInfo>>;
|
|
30
|
+
static get p(): PhantomReified<"0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e::price_info::PriceInfo">;
|
|
31
|
+
static get bcs(): import("@mysten/sui/bcs").BcsType<{
|
|
32
|
+
attestation_time: string;
|
|
33
|
+
arrival_time: string;
|
|
34
|
+
price_feed: {
|
|
35
|
+
price_identifier: {
|
|
36
|
+
bytes: number[];
|
|
37
|
+
};
|
|
38
|
+
price: {
|
|
39
|
+
price: {
|
|
40
|
+
negative: boolean;
|
|
41
|
+
magnitude: string;
|
|
42
|
+
};
|
|
43
|
+
conf: string;
|
|
44
|
+
expo: {
|
|
45
|
+
negative: boolean;
|
|
46
|
+
magnitude: string;
|
|
47
|
+
};
|
|
48
|
+
timestamp: string;
|
|
49
|
+
};
|
|
50
|
+
ema_price: {
|
|
51
|
+
price: {
|
|
52
|
+
negative: boolean;
|
|
53
|
+
magnitude: string;
|
|
54
|
+
};
|
|
55
|
+
conf: string;
|
|
56
|
+
expo: {
|
|
57
|
+
negative: boolean;
|
|
58
|
+
magnitude: string;
|
|
59
|
+
};
|
|
60
|
+
timestamp: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
}, {
|
|
64
|
+
attestation_time: string | number | bigint;
|
|
65
|
+
arrival_time: string | number | bigint;
|
|
66
|
+
price_feed: {
|
|
67
|
+
price_identifier: {
|
|
68
|
+
bytes: Iterable<number> & {
|
|
69
|
+
length: number;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
price: {
|
|
73
|
+
price: {
|
|
74
|
+
negative: boolean;
|
|
75
|
+
magnitude: string | number | bigint;
|
|
76
|
+
};
|
|
77
|
+
conf: string | number | bigint;
|
|
78
|
+
expo: {
|
|
79
|
+
negative: boolean;
|
|
80
|
+
magnitude: string | number | bigint;
|
|
81
|
+
};
|
|
82
|
+
timestamp: string | number | bigint;
|
|
83
|
+
};
|
|
84
|
+
ema_price: {
|
|
85
|
+
price: {
|
|
86
|
+
negative: boolean;
|
|
87
|
+
magnitude: string | number | bigint;
|
|
88
|
+
};
|
|
89
|
+
conf: string | number | bigint;
|
|
90
|
+
expo: {
|
|
91
|
+
negative: boolean;
|
|
92
|
+
magnitude: string | number | bigint;
|
|
93
|
+
};
|
|
94
|
+
timestamp: string | number | bigint;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
}>;
|
|
98
|
+
static fromFields(fields: Record<string, any>): PriceInfo;
|
|
99
|
+
static fromFieldsWithTypes(item: FieldsWithTypes): PriceInfo;
|
|
100
|
+
static fromBcs(data: Uint8Array): PriceInfo;
|
|
101
|
+
toJSONField(): {
|
|
102
|
+
attestationTime: string;
|
|
103
|
+
arrivalTime: string;
|
|
104
|
+
priceFeed: {
|
|
105
|
+
priceIdentifier: {
|
|
106
|
+
bytes: number[];
|
|
107
|
+
};
|
|
108
|
+
price: {
|
|
109
|
+
price: {
|
|
110
|
+
negative: boolean;
|
|
111
|
+
magnitude: string;
|
|
112
|
+
};
|
|
113
|
+
conf: string;
|
|
114
|
+
expo: {
|
|
115
|
+
negative: boolean;
|
|
116
|
+
magnitude: string;
|
|
117
|
+
};
|
|
118
|
+
timestamp: string;
|
|
119
|
+
};
|
|
120
|
+
emaPrice: {
|
|
121
|
+
price: {
|
|
122
|
+
negative: boolean;
|
|
123
|
+
magnitude: string;
|
|
124
|
+
};
|
|
125
|
+
conf: string;
|
|
126
|
+
expo: {
|
|
127
|
+
negative: boolean;
|
|
128
|
+
magnitude: string;
|
|
129
|
+
};
|
|
130
|
+
timestamp: string;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
toJSON(): {
|
|
135
|
+
attestationTime: string;
|
|
136
|
+
arrivalTime: string;
|
|
137
|
+
priceFeed: {
|
|
138
|
+
priceIdentifier: {
|
|
139
|
+
bytes: number[];
|
|
140
|
+
};
|
|
141
|
+
price: {
|
|
142
|
+
price: {
|
|
143
|
+
negative: boolean;
|
|
144
|
+
magnitude: string;
|
|
145
|
+
};
|
|
146
|
+
conf: string;
|
|
147
|
+
expo: {
|
|
148
|
+
negative: boolean;
|
|
149
|
+
magnitude: string;
|
|
150
|
+
};
|
|
151
|
+
timestamp: string;
|
|
152
|
+
};
|
|
153
|
+
emaPrice: {
|
|
154
|
+
price: {
|
|
155
|
+
negative: boolean;
|
|
156
|
+
magnitude: string;
|
|
157
|
+
};
|
|
158
|
+
conf: string;
|
|
159
|
+
expo: {
|
|
160
|
+
negative: boolean;
|
|
161
|
+
magnitude: string;
|
|
162
|
+
};
|
|
163
|
+
timestamp: string;
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
$typeName: string;
|
|
167
|
+
$typeArgs: [];
|
|
168
|
+
};
|
|
169
|
+
static fromJSONField(field: any): PriceInfo;
|
|
170
|
+
static fromJSON(json: Record<string, any>): PriceInfo;
|
|
171
|
+
static fromSuiParsedData(content: SuiParsedData): PriceInfo;
|
|
172
|
+
static fromSuiObjectData(data: SuiObjectData): PriceInfo;
|
|
173
|
+
static fetch(client: SuiClient, id: string): Promise<PriceInfo>;
|
|
174
|
+
}
|
|
175
|
+
export declare function isPriceInfoObject(type: string): boolean;
|
|
176
|
+
export interface PriceInfoObjectFields {
|
|
177
|
+
id: ToField<UID>;
|
|
178
|
+
priceInfo: ToField<PriceInfo>;
|
|
179
|
+
}
|
|
180
|
+
export type PriceInfoObjectReified = Reified<PriceInfoObject, PriceInfoObjectFields>;
|
|
181
|
+
export declare class PriceInfoObject implements StructClass {
|
|
182
|
+
__StructClass: true;
|
|
183
|
+
static readonly $typeName = "0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e::price_info::PriceInfoObject";
|
|
184
|
+
static readonly $numTypeParams = 0;
|
|
185
|
+
static readonly $isPhantom: readonly [];
|
|
186
|
+
readonly $typeName = "0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e::price_info::PriceInfoObject";
|
|
187
|
+
readonly $fullTypeName: `${typeof PKG_V1}::price_info::PriceInfoObject`;
|
|
188
|
+
readonly $typeArgs: [];
|
|
189
|
+
readonly $isPhantom: readonly [];
|
|
190
|
+
readonly id: ToField<UID>;
|
|
191
|
+
readonly priceInfo: ToField<PriceInfo>;
|
|
192
|
+
private constructor();
|
|
193
|
+
static reified(): PriceInfoObjectReified;
|
|
194
|
+
static get r(): import("../../../../_framework/reified").StructClassReified<PriceInfoObject, PriceInfoObjectFields>;
|
|
195
|
+
static phantom(): PhantomReified<ToTypeStr<PriceInfoObject>>;
|
|
196
|
+
static get p(): PhantomReified<"0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e::price_info::PriceInfoObject">;
|
|
197
|
+
static get bcs(): import("@mysten/sui/bcs").BcsType<{
|
|
198
|
+
id: {
|
|
199
|
+
id: {
|
|
200
|
+
bytes: string;
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
price_info: {
|
|
204
|
+
attestation_time: string;
|
|
205
|
+
arrival_time: string;
|
|
206
|
+
price_feed: {
|
|
207
|
+
price_identifier: {
|
|
208
|
+
bytes: number[];
|
|
209
|
+
};
|
|
210
|
+
price: {
|
|
211
|
+
price: {
|
|
212
|
+
negative: boolean;
|
|
213
|
+
magnitude: string;
|
|
214
|
+
};
|
|
215
|
+
conf: string;
|
|
216
|
+
expo: {
|
|
217
|
+
negative: boolean;
|
|
218
|
+
magnitude: string;
|
|
219
|
+
};
|
|
220
|
+
timestamp: string;
|
|
221
|
+
};
|
|
222
|
+
ema_price: {
|
|
223
|
+
price: {
|
|
224
|
+
negative: boolean;
|
|
225
|
+
magnitude: string;
|
|
226
|
+
};
|
|
227
|
+
conf: string;
|
|
228
|
+
expo: {
|
|
229
|
+
negative: boolean;
|
|
230
|
+
magnitude: string;
|
|
231
|
+
};
|
|
232
|
+
timestamp: string;
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
}, {
|
|
237
|
+
id: {
|
|
238
|
+
id: {
|
|
239
|
+
bytes: string;
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
price_info: {
|
|
243
|
+
attestation_time: string | number | bigint;
|
|
244
|
+
arrival_time: string | number | bigint;
|
|
245
|
+
price_feed: {
|
|
246
|
+
price_identifier: {
|
|
247
|
+
bytes: Iterable<number> & {
|
|
248
|
+
length: number;
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
price: {
|
|
252
|
+
price: {
|
|
253
|
+
negative: boolean;
|
|
254
|
+
magnitude: string | number | bigint;
|
|
255
|
+
};
|
|
256
|
+
conf: string | number | bigint;
|
|
257
|
+
expo: {
|
|
258
|
+
negative: boolean;
|
|
259
|
+
magnitude: string | number | bigint;
|
|
260
|
+
};
|
|
261
|
+
timestamp: string | number | bigint;
|
|
262
|
+
};
|
|
263
|
+
ema_price: {
|
|
264
|
+
price: {
|
|
265
|
+
negative: boolean;
|
|
266
|
+
magnitude: string | number | bigint;
|
|
267
|
+
};
|
|
268
|
+
conf: string | number | bigint;
|
|
269
|
+
expo: {
|
|
270
|
+
negative: boolean;
|
|
271
|
+
magnitude: string | number | bigint;
|
|
272
|
+
};
|
|
273
|
+
timestamp: string | number | bigint;
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
}>;
|
|
278
|
+
static fromFields(fields: Record<string, any>): PriceInfoObject;
|
|
279
|
+
static fromFieldsWithTypes(item: FieldsWithTypes): PriceInfoObject;
|
|
280
|
+
static fromBcs(data: Uint8Array): PriceInfoObject;
|
|
281
|
+
toJSONField(): {
|
|
282
|
+
id: string;
|
|
283
|
+
priceInfo: {
|
|
284
|
+
attestationTime: string;
|
|
285
|
+
arrivalTime: string;
|
|
286
|
+
priceFeed: {
|
|
287
|
+
priceIdentifier: {
|
|
288
|
+
bytes: number[];
|
|
289
|
+
};
|
|
290
|
+
price: {
|
|
291
|
+
price: {
|
|
292
|
+
negative: boolean;
|
|
293
|
+
magnitude: string;
|
|
294
|
+
};
|
|
295
|
+
conf: string;
|
|
296
|
+
expo: {
|
|
297
|
+
negative: boolean;
|
|
298
|
+
magnitude: string;
|
|
299
|
+
};
|
|
300
|
+
timestamp: string;
|
|
301
|
+
};
|
|
302
|
+
emaPrice: {
|
|
303
|
+
price: {
|
|
304
|
+
negative: boolean;
|
|
305
|
+
magnitude: string;
|
|
306
|
+
};
|
|
307
|
+
conf: string;
|
|
308
|
+
expo: {
|
|
309
|
+
negative: boolean;
|
|
310
|
+
magnitude: string;
|
|
311
|
+
};
|
|
312
|
+
timestamp: string;
|
|
313
|
+
};
|
|
314
|
+
};
|
|
315
|
+
};
|
|
316
|
+
};
|
|
317
|
+
toJSON(): {
|
|
318
|
+
id: string;
|
|
319
|
+
priceInfo: {
|
|
320
|
+
attestationTime: string;
|
|
321
|
+
arrivalTime: string;
|
|
322
|
+
priceFeed: {
|
|
323
|
+
priceIdentifier: {
|
|
324
|
+
bytes: number[];
|
|
325
|
+
};
|
|
326
|
+
price: {
|
|
327
|
+
price: {
|
|
328
|
+
negative: boolean;
|
|
329
|
+
magnitude: string;
|
|
330
|
+
};
|
|
331
|
+
conf: string;
|
|
332
|
+
expo: {
|
|
333
|
+
negative: boolean;
|
|
334
|
+
magnitude: string;
|
|
335
|
+
};
|
|
336
|
+
timestamp: string;
|
|
337
|
+
};
|
|
338
|
+
emaPrice: {
|
|
339
|
+
price: {
|
|
340
|
+
negative: boolean;
|
|
341
|
+
magnitude: string;
|
|
342
|
+
};
|
|
343
|
+
conf: string;
|
|
344
|
+
expo: {
|
|
345
|
+
negative: boolean;
|
|
346
|
+
magnitude: string;
|
|
347
|
+
};
|
|
348
|
+
timestamp: string;
|
|
349
|
+
};
|
|
350
|
+
};
|
|
351
|
+
};
|
|
352
|
+
$typeName: string;
|
|
353
|
+
$typeArgs: [];
|
|
354
|
+
};
|
|
355
|
+
static fromJSONField(field: any): PriceInfoObject;
|
|
356
|
+
static fromJSON(json: Record<string, any>): PriceInfoObject;
|
|
357
|
+
static fromSuiParsedData(content: SuiParsedData): PriceInfoObject;
|
|
358
|
+
static fromSuiObjectData(data: SuiObjectData): PriceInfoObject;
|
|
359
|
+
static fetch(client: SuiClient, id: string): Promise<PriceInfoObject>;
|
|
360
|
+
}
|