@suilend/sdk 1.1.22 → 1.1.24

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.
@@ -0,0 +1,52 @@
1
+ import { PhantomReified, Reified, StructClass, ToField, ToTypeStr } from "../../../../_framework/reified";
2
+ import { FieldsWithTypes } from "../../../../_framework/util";
3
+ import { PKG_V1 } from "../index";
4
+ import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
5
+ export declare function isI64(type: string): boolean;
6
+ export interface I64Fields {
7
+ negative: ToField<"bool">;
8
+ magnitude: ToField<"u64">;
9
+ }
10
+ export type I64Reified = Reified<I64, I64Fields>;
11
+ export declare class I64 implements StructClass {
12
+ __StructClass: true;
13
+ static readonly $typeName = "0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e::i64::I64";
14
+ static readonly $numTypeParams = 0;
15
+ static readonly $isPhantom: readonly [];
16
+ readonly $typeName = "0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e::i64::I64";
17
+ readonly $fullTypeName: `${typeof PKG_V1}::i64::I64`;
18
+ readonly $typeArgs: [];
19
+ readonly $isPhantom: readonly [];
20
+ readonly negative: ToField<"bool">;
21
+ readonly magnitude: ToField<"u64">;
22
+ private constructor();
23
+ static reified(): I64Reified;
24
+ static get r(): import("../../../../_framework/reified").StructClassReified<I64, I64Fields>;
25
+ static phantom(): PhantomReified<ToTypeStr<I64>>;
26
+ static get p(): PhantomReified<"0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e::i64::I64">;
27
+ static get bcs(): import("@mysten/sui/bcs").BcsType<{
28
+ negative: boolean;
29
+ magnitude: string;
30
+ }, {
31
+ negative: boolean;
32
+ magnitude: string | number | bigint;
33
+ }>;
34
+ static fromFields(fields: Record<string, any>): I64;
35
+ static fromFieldsWithTypes(item: FieldsWithTypes): I64;
36
+ static fromBcs(data: Uint8Array): I64;
37
+ toJSONField(): {
38
+ negative: boolean;
39
+ magnitude: string;
40
+ };
41
+ toJSON(): {
42
+ negative: boolean;
43
+ magnitude: string;
44
+ $typeName: string;
45
+ $typeArgs: [];
46
+ };
47
+ static fromJSONField(field: any): I64;
48
+ static fromJSON(json: Record<string, any>): I64;
49
+ static fromSuiParsedData(content: SuiParsedData): I64;
50
+ static fromSuiObjectData(data: SuiObjectData): I64;
51
+ static fetch(client: SuiClient, id: string): Promise<I64>;
52
+ }
@@ -0,0 +1,148 @@
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.I64 = void 0;
13
+ exports.isI64 = isI64;
14
+ const reified_1 = require("../../../../_framework/reified");
15
+ const util_1 = require("../../../../_framework/util");
16
+ const index_1 = require("../index");
17
+ const bcs_1 = require("@mysten/sui/bcs");
18
+ const utils_1 = require("@mysten/sui/utils");
19
+ /* ============================== I64 =============================== */
20
+ function isI64(type) {
21
+ type = (0, util_1.compressSuiType)(type);
22
+ return type === `${index_1.PKG_V1}::i64::I64`;
23
+ }
24
+ class I64 {
25
+ constructor(typeArgs, fields) {
26
+ this.__StructClass = true;
27
+ this.$typeName = I64.$typeName;
28
+ this.$isPhantom = I64.$isPhantom;
29
+ this.$fullTypeName = (0, util_1.composeSuiType)(I64.$typeName, ...typeArgs);
30
+ this.$typeArgs = typeArgs;
31
+ this.negative = fields.negative;
32
+ this.magnitude = fields.magnitude;
33
+ }
34
+ static reified() {
35
+ return {
36
+ typeName: I64.$typeName,
37
+ fullTypeName: (0, util_1.composeSuiType)(I64.$typeName, ...[]),
38
+ typeArgs: [],
39
+ isPhantom: I64.$isPhantom,
40
+ reifiedTypeArgs: [],
41
+ fromFields: (fields) => I64.fromFields(fields),
42
+ fromFieldsWithTypes: (item) => I64.fromFieldsWithTypes(item),
43
+ fromBcs: (data) => I64.fromBcs(data),
44
+ bcs: I64.bcs,
45
+ fromJSONField: (field) => I64.fromJSONField(field),
46
+ fromJSON: (json) => I64.fromJSON(json),
47
+ fromSuiParsedData: (content) => I64.fromSuiParsedData(content),
48
+ fromSuiObjectData: (content) => I64.fromSuiObjectData(content),
49
+ fetch: (client, id) => __awaiter(this, void 0, void 0, function* () { return I64.fetch(client, id); }),
50
+ new: (fields) => {
51
+ return new I64([], fields);
52
+ },
53
+ kind: "StructClassReified",
54
+ };
55
+ }
56
+ static get r() {
57
+ return I64.reified();
58
+ }
59
+ static phantom() {
60
+ return (0, reified_1.phantom)(I64.reified());
61
+ }
62
+ static get p() {
63
+ return I64.phantom();
64
+ }
65
+ static get bcs() {
66
+ return bcs_1.bcs.struct("I64", {
67
+ negative: bcs_1.bcs.bool(),
68
+ magnitude: bcs_1.bcs.u64(),
69
+ });
70
+ }
71
+ static fromFields(fields) {
72
+ return I64.reified().new({
73
+ negative: (0, reified_1.decodeFromFields)("bool", fields.negative),
74
+ magnitude: (0, reified_1.decodeFromFields)("u64", fields.magnitude),
75
+ });
76
+ }
77
+ static fromFieldsWithTypes(item) {
78
+ if (!isI64(item.type)) {
79
+ throw new Error("not a I64 type");
80
+ }
81
+ return I64.reified().new({
82
+ negative: (0, reified_1.decodeFromFieldsWithTypes)("bool", item.fields.negative),
83
+ magnitude: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.magnitude),
84
+ });
85
+ }
86
+ static fromBcs(data) {
87
+ return I64.fromFields(I64.bcs.parse(data));
88
+ }
89
+ toJSONField() {
90
+ return {
91
+ negative: this.negative,
92
+ magnitude: this.magnitude.toString(),
93
+ };
94
+ }
95
+ toJSON() {
96
+ return Object.assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
97
+ }
98
+ static fromJSONField(field) {
99
+ return I64.reified().new({
100
+ negative: (0, reified_1.decodeFromJSONField)("bool", field.negative),
101
+ magnitude: (0, reified_1.decodeFromJSONField)("u64", field.magnitude),
102
+ });
103
+ }
104
+ static fromJSON(json) {
105
+ if (json.$typeName !== I64.$typeName) {
106
+ throw new Error("not a WithTwoGenerics json object");
107
+ }
108
+ return I64.fromJSONField(json);
109
+ }
110
+ static fromSuiParsedData(content) {
111
+ if (content.dataType !== "moveObject") {
112
+ throw new Error("not an object");
113
+ }
114
+ if (!isI64(content.type)) {
115
+ throw new Error(`object at ${content.fields.id} is not a I64 object`);
116
+ }
117
+ return I64.fromFieldsWithTypes(content);
118
+ }
119
+ static fromSuiObjectData(data) {
120
+ if (data.bcs) {
121
+ if (data.bcs.dataType !== "moveObject" || !isI64(data.bcs.type)) {
122
+ throw new Error(`object at is not a I64 object`);
123
+ }
124
+ return I64.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
125
+ }
126
+ if (data.content) {
127
+ return I64.fromSuiParsedData(data.content);
128
+ }
129
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
130
+ }
131
+ static fetch(client, id) {
132
+ return __awaiter(this, void 0, void 0, function* () {
133
+ var _a, _b;
134
+ const res = yield client.getObject({ id, options: { showBcs: true } });
135
+ if (res.error) {
136
+ throw new Error(`error fetching I64 object at id ${id}: ${res.error.code}`);
137
+ }
138
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isI64(res.data.bcs.type)) {
139
+ throw new Error(`object at id ${id} is not a I64 object`);
140
+ }
141
+ return I64.fromSuiObjectData(res.data);
142
+ });
143
+ }
144
+ }
145
+ exports.I64 = I64;
146
+ I64.$typeName = `${index_1.PKG_V1}::i64::I64`;
147
+ I64.$numTypeParams = 0;
148
+ I64.$isPhantom = [];
@@ -0,0 +1,89 @@
1
+ import { PhantomReified, Reified, StructClass, ToField, ToTypeStr } from "../../../../_framework/reified";
2
+ import { FieldsWithTypes } from "../../../../_framework/util";
3
+ import { I64 } from "../i64/structs";
4
+ import { PKG_V1 } from "../index";
5
+ import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
6
+ export declare function isPrice(type: string): boolean;
7
+ export interface PriceFields {
8
+ price: ToField<I64>;
9
+ conf: ToField<"u64">;
10
+ expo: ToField<I64>;
11
+ timestamp: ToField<"u64">;
12
+ }
13
+ export type PriceReified = Reified<Price, PriceFields>;
14
+ export declare class Price implements StructClass {
15
+ __StructClass: true;
16
+ static readonly $typeName = "0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e::price::Price";
17
+ static readonly $numTypeParams = 0;
18
+ static readonly $isPhantom: readonly [];
19
+ readonly $typeName = "0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e::price::Price";
20
+ readonly $fullTypeName: `${typeof PKG_V1}::price::Price`;
21
+ readonly $typeArgs: [];
22
+ readonly $isPhantom: readonly [];
23
+ readonly price: ToField<I64>;
24
+ readonly conf: ToField<"u64">;
25
+ readonly expo: ToField<I64>;
26
+ readonly timestamp: ToField<"u64">;
27
+ private constructor();
28
+ static reified(): PriceReified;
29
+ static get r(): import("../../../../_framework/reified").StructClassReified<Price, PriceFields>;
30
+ static phantom(): PhantomReified<ToTypeStr<Price>>;
31
+ static get p(): PhantomReified<"0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e::price::Price">;
32
+ static get bcs(): import("@mysten/sui/bcs").BcsType<{
33
+ price: {
34
+ negative: boolean;
35
+ magnitude: string;
36
+ };
37
+ conf: string;
38
+ expo: {
39
+ negative: boolean;
40
+ magnitude: string;
41
+ };
42
+ timestamp: string;
43
+ }, {
44
+ price: {
45
+ negative: boolean;
46
+ magnitude: string | number | bigint;
47
+ };
48
+ conf: string | number | bigint;
49
+ expo: {
50
+ negative: boolean;
51
+ magnitude: string | number | bigint;
52
+ };
53
+ timestamp: string | number | bigint;
54
+ }>;
55
+ static fromFields(fields: Record<string, any>): Price;
56
+ static fromFieldsWithTypes(item: FieldsWithTypes): Price;
57
+ static fromBcs(data: Uint8Array): Price;
58
+ toJSONField(): {
59
+ price: {
60
+ negative: boolean;
61
+ magnitude: string;
62
+ };
63
+ conf: string;
64
+ expo: {
65
+ negative: boolean;
66
+ magnitude: string;
67
+ };
68
+ timestamp: string;
69
+ };
70
+ toJSON(): {
71
+ price: {
72
+ negative: boolean;
73
+ magnitude: string;
74
+ };
75
+ conf: string;
76
+ expo: {
77
+ negative: boolean;
78
+ magnitude: string;
79
+ };
80
+ timestamp: string;
81
+ $typeName: string;
82
+ $typeArgs: [];
83
+ };
84
+ static fromJSONField(field: any): Price;
85
+ static fromJSON(json: Record<string, any>): Price;
86
+ static fromSuiParsedData(content: SuiParsedData): Price;
87
+ static fromSuiObjectData(data: SuiObjectData): Price;
88
+ static fetch(client: SuiClient, id: string): Promise<Price>;
89
+ }
@@ -0,0 +1,162 @@
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.Price = void 0;
13
+ exports.isPrice = isPrice;
14
+ const reified_1 = require("../../../../_framework/reified");
15
+ const util_1 = require("../../../../_framework/util");
16
+ const structs_1 = require("../i64/structs");
17
+ const index_1 = require("../index");
18
+ const bcs_1 = require("@mysten/sui/bcs");
19
+ const utils_1 = require("@mysten/sui/utils");
20
+ /* ============================== Price =============================== */
21
+ function isPrice(type) {
22
+ type = (0, util_1.compressSuiType)(type);
23
+ return type === `${index_1.PKG_V1}::price::Price`;
24
+ }
25
+ class Price {
26
+ constructor(typeArgs, fields) {
27
+ this.__StructClass = true;
28
+ this.$typeName = Price.$typeName;
29
+ this.$isPhantom = Price.$isPhantom;
30
+ this.$fullTypeName = (0, util_1.composeSuiType)(Price.$typeName, ...typeArgs);
31
+ this.$typeArgs = typeArgs;
32
+ this.price = fields.price;
33
+ this.conf = fields.conf;
34
+ this.expo = fields.expo;
35
+ this.timestamp = fields.timestamp;
36
+ }
37
+ static reified() {
38
+ return {
39
+ typeName: Price.$typeName,
40
+ fullTypeName: (0, util_1.composeSuiType)(Price.$typeName, ...[]),
41
+ typeArgs: [],
42
+ isPhantom: Price.$isPhantom,
43
+ reifiedTypeArgs: [],
44
+ fromFields: (fields) => Price.fromFields(fields),
45
+ fromFieldsWithTypes: (item) => Price.fromFieldsWithTypes(item),
46
+ fromBcs: (data) => Price.fromBcs(data),
47
+ bcs: Price.bcs,
48
+ fromJSONField: (field) => Price.fromJSONField(field),
49
+ fromJSON: (json) => Price.fromJSON(json),
50
+ fromSuiParsedData: (content) => Price.fromSuiParsedData(content),
51
+ fromSuiObjectData: (content) => Price.fromSuiObjectData(content),
52
+ fetch: (client, id) => __awaiter(this, void 0, void 0, function* () { return Price.fetch(client, id); }),
53
+ new: (fields) => {
54
+ return new Price([], fields);
55
+ },
56
+ kind: "StructClassReified",
57
+ };
58
+ }
59
+ static get r() {
60
+ return Price.reified();
61
+ }
62
+ static phantom() {
63
+ return (0, reified_1.phantom)(Price.reified());
64
+ }
65
+ static get p() {
66
+ return Price.phantom();
67
+ }
68
+ static get bcs() {
69
+ return bcs_1.bcs.struct("Price", {
70
+ price: structs_1.I64.bcs,
71
+ conf: bcs_1.bcs.u64(),
72
+ expo: structs_1.I64.bcs,
73
+ timestamp: bcs_1.bcs.u64(),
74
+ });
75
+ }
76
+ static fromFields(fields) {
77
+ return Price.reified().new({
78
+ price: (0, reified_1.decodeFromFields)(structs_1.I64.reified(), fields.price),
79
+ conf: (0, reified_1.decodeFromFields)("u64", fields.conf),
80
+ expo: (0, reified_1.decodeFromFields)(structs_1.I64.reified(), fields.expo),
81
+ timestamp: (0, reified_1.decodeFromFields)("u64", fields.timestamp),
82
+ });
83
+ }
84
+ static fromFieldsWithTypes(item) {
85
+ if (!isPrice(item.type)) {
86
+ throw new Error("not a Price type");
87
+ }
88
+ return Price.reified().new({
89
+ price: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.I64.reified(), item.fields.price),
90
+ conf: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.conf),
91
+ expo: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.I64.reified(), item.fields.expo),
92
+ timestamp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.timestamp),
93
+ });
94
+ }
95
+ static fromBcs(data) {
96
+ return Price.fromFields(Price.bcs.parse(data));
97
+ }
98
+ toJSONField() {
99
+ return {
100
+ price: this.price.toJSONField(),
101
+ conf: this.conf.toString(),
102
+ expo: this.expo.toJSONField(),
103
+ timestamp: this.timestamp.toString(),
104
+ };
105
+ }
106
+ toJSON() {
107
+ return Object.assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
108
+ }
109
+ static fromJSONField(field) {
110
+ return Price.reified().new({
111
+ price: (0, reified_1.decodeFromJSONField)(structs_1.I64.reified(), field.price),
112
+ conf: (0, reified_1.decodeFromJSONField)("u64", field.conf),
113
+ expo: (0, reified_1.decodeFromJSONField)(structs_1.I64.reified(), field.expo),
114
+ timestamp: (0, reified_1.decodeFromJSONField)("u64", field.timestamp),
115
+ });
116
+ }
117
+ static fromJSON(json) {
118
+ if (json.$typeName !== Price.$typeName) {
119
+ throw new Error("not a WithTwoGenerics json object");
120
+ }
121
+ return Price.fromJSONField(json);
122
+ }
123
+ static fromSuiParsedData(content) {
124
+ if (content.dataType !== "moveObject") {
125
+ throw new Error("not an object");
126
+ }
127
+ if (!isPrice(content.type)) {
128
+ throw new Error(`object at ${content.fields.id} is not a Price object`);
129
+ }
130
+ return Price.fromFieldsWithTypes(content);
131
+ }
132
+ static fromSuiObjectData(data) {
133
+ if (data.bcs) {
134
+ if (data.bcs.dataType !== "moveObject" || !isPrice(data.bcs.type)) {
135
+ throw new Error(`object at is not a Price object`);
136
+ }
137
+ return Price.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
138
+ }
139
+ if (data.content) {
140
+ return Price.fromSuiParsedData(data.content);
141
+ }
142
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
143
+ }
144
+ static fetch(client, id) {
145
+ return __awaiter(this, void 0, void 0, function* () {
146
+ var _a, _b;
147
+ const res = yield client.getObject({ id, options: { showBcs: true } });
148
+ if (res.error) {
149
+ throw new Error(`error fetching Price object at id ${id}: ${res.error.code}`);
150
+ }
151
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" ||
152
+ !isPrice(res.data.bcs.type)) {
153
+ throw new Error(`object at id ${id} is not a Price object`);
154
+ }
155
+ return Price.fromSuiObjectData(res.data);
156
+ });
157
+ }
158
+ }
159
+ exports.Price = Price;
160
+ Price.$typeName = `${index_1.PKG_V1}::price::Price`;
161
+ Price.$numTypeParams = 0;
162
+ Price.$isPhantom = [];
@@ -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
+ }