@typus/typus-perp-sdk 1.0.20 → 1.0.21-tk1

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.
Files changed (38) hide show
  1. package/dist/src/api/sentio.js +1 -1
  2. package/dist/src/fetch.js +20 -27
  3. package/dist/src/index.d.ts +1 -1
  4. package/dist/src/index.js +16 -12
  5. package/dist/src/typus_perp/admin/structs.d.ts +5 -5
  6. package/dist/src/typus_perp/error/functions.d.ts +2 -2
  7. package/dist/src/typus_perp/error/functions.js +8 -8
  8. package/dist/src/typus_perp/escrow/structs.d.ts +1 -1
  9. package/dist/src/typus_perp/index.js +3 -3
  10. package/dist/src/typus_perp/init.js +0 -3
  11. package/dist/src/typus_perp/lp-pool/functions.d.ts +2 -10
  12. package/dist/src/typus_perp/lp-pool/functions.js +7 -27
  13. package/dist/src/typus_perp/lp-pool/structs.d.ts +26 -26
  14. package/dist/src/typus_perp/position/functions.d.ts +21 -6
  15. package/dist/src/typus_perp/position/functions.js +42 -6
  16. package/dist/src/typus_perp/position/structs.d.ts +6 -6
  17. package/dist/src/typus_perp/symbol/structs.d.ts +1 -1
  18. package/dist/src/typus_perp/tlp/structs.d.ts +2 -2
  19. package/dist/src/typus_perp/trading/functions.d.ts +50 -70
  20. package/dist/src/typus_perp/trading/functions.js +50 -70
  21. package/dist/src/typus_perp/trading/structs.d.ts +52 -30
  22. package/dist/src/typus_perp/trading/structs.js +6 -0
  23. package/dist/src/typus_perp/treasury-caps/structs.d.ts +1 -1
  24. package/dist/src/typus_stake_pool/admin/structs.d.ts +4 -4
  25. package/dist/src/typus_stake_pool/index.js +3 -3
  26. package/dist/src/typus_stake_pool/stake-pool/functions.d.ts +0 -1
  27. package/dist/src/typus_stake_pool/stake-pool/functions.js +0 -1
  28. package/dist/src/typus_stake_pool/stake-pool/structs.d.ts +22 -22
  29. package/dist/src/user/history.js +10 -10
  30. package/dist/src/user/order.js +87 -42
  31. package/dist/src/user/orderWithBidReceipt.js +58 -26
  32. package/dist/src/user/tlp.d.ts +4 -3
  33. package/dist/src/user/tlp.js +93 -60
  34. package/package.json +2 -2
  35. package/dist/src/typus_perp/oracle/functions.d.ts +0 -13
  36. package/dist/src/typus_perp/oracle/functions.js +0 -22
  37. package/dist/src/typus_perp/oracle/structs.d.ts +0 -111
  38. package/dist/src/typus_perp/oracle/structs.js +0 -389
@@ -2,19 +2,20 @@ import { Transaction } from "@mysten/sui/transactions";
2
2
  import { LiquidityPool } from "../typus_perp/lp-pool/structs";
3
3
  import { PythClient, TypusConfig } from "@typus/typus-sdk/dist/src/utils";
4
4
  import { TOKEN } from "@typus/typus-sdk/dist/src/constants";
5
+ import { StakePool } from "../../src/typus_stake_pool/stake-pool/structs";
5
6
  export declare function mintStakeLp(config: TypusConfig, tx: Transaction, pythClient: PythClient, input: {
6
7
  lpPool: LiquidityPool;
8
+ stakePool: StakePool;
7
9
  coins: string[];
8
10
  cTOKEN: TOKEN;
9
- iTOKEN: TOKEN;
10
11
  amount: string;
11
12
  userShareId: string | null;
12
13
  user: string;
13
14
  }): Promise<Transaction>;
14
15
  export declare function unstakeBurn(config: TypusConfig, tx: Transaction, pythClient: PythClient, input: {
15
16
  lpPool: LiquidityPool;
17
+ stakePool: StakePool;
16
18
  cTOKEN: TOKEN;
17
- iTOKEN: TOKEN;
18
19
  userShareId: string;
19
20
  share: string | null;
20
21
  user: string;
@@ -31,7 +32,7 @@ export declare function unsubscribe(config: TypusConfig, tx: Transaction, input:
31
32
  share: string | null;
32
33
  }): Promise<Transaction>;
33
34
  export declare function harvestStakeReward(config: TypusConfig, tx: Transaction, input: {
35
+ stakePool: StakePool;
34
36
  userShareId: string;
35
37
  user: string;
36
- iTOKEN: TOKEN;
37
38
  }): Promise<Transaction>;
@@ -75,27 +75,26 @@ var constants_1 = require("@typus/typus-sdk/dist/src/constants");
75
75
  var __1 = require("..");
76
76
  function mintStakeLp(config, tx, pythClient, input) {
77
77
  return __awaiter(this, void 0, void 0, function () {
78
- var tokens, cToken, tokens_1, tokens_1_1, token, coin, destination, iToken, iCoin, lpCoin;
79
- var e_1, _a, _b, _c;
80
- return __generator(this, function (_d) {
81
- switch (_d.label) {
78
+ var tokens, tokens_1, tokens_1_1, token, coin, destination, iTokens, iTokens_1, iTokens_1_1, iToken, iCoin, cToken, lpCoin;
79
+ var e_1, _a, _b, _c, e_2, _d;
80
+ return __generator(this, function (_e) {
81
+ switch (_e.label) {
82
82
  case 0:
83
83
  tokens = input.lpPool.tokenPools.map(function (p) { return (0, constants_1.typeArgToAsset)("0x" + p.tokenType.name); });
84
84
  // console.log("tokens", tokens);
85
85
  return [4 /*yield*/, (0, utils_1.updatePyth)(pythClient, tx, tokens)];
86
86
  case 1:
87
87
  // console.log("tokens", tokens);
88
- _d.sent();
89
- cToken = constants_1.tokenType[__1.NETWORK][input.cTOKEN];
88
+ _e.sent();
90
89
  try {
91
90
  for (tokens_1 = __values(tokens), tokens_1_1 = tokens_1.next(); !tokens_1_1.done; tokens_1_1 = tokens_1.next()) {
92
91
  token = tokens_1_1.value;
92
+ (0, utils_1.updateOracleWithPythUsd)(pythClient, tx, config.package.oracle, token);
93
93
  (0, functions_1.updateLiquidityValue)(tx, constants_1.tokenType[__1.NETWORK][token], {
94
94
  version: __1.PERP_VERSION,
95
95
  registry: __1.LP_POOL,
96
96
  index: BigInt(0),
97
- pythState: utils_1.pythStateId[__1.NETWORK],
98
- oracle: utils_1.priceInfoObjectIds[__1.NETWORK][token],
97
+ oracle: constants_1.oracle[__1.NETWORK][token],
99
98
  clock: constants_1.CLOCK,
100
99
  });
101
100
  }
@@ -117,25 +116,37 @@ function mintStakeLp(config, tx, pythClient, input) {
117
116
  }
118
117
  _c = __read(tx.splitCoins(destination, [input.amount]), 1), coin = _c[0];
119
118
  }
120
- iToken = constants_1.tokenType[__1.NETWORK][input.iTOKEN];
121
119
  // console.log(iToken);
122
120
  if (input.userShareId) {
123
- iCoin = (0, functions_2.harvestPerUserShare)(tx, iToken, {
124
- version: __1.STAKE_POOL_VERSION,
125
- registry: __1.STAKE_POOL,
126
- index: BigInt(0),
127
- userShareId: BigInt(input.userShareId),
128
- clock: constants_1.CLOCK,
129
- });
130
- tx.transferObjects([iCoin], input.user);
121
+ iTokens = input.stakePool.incentives.map(function (i) { return i.tokenType.name; });
122
+ try {
123
+ for (iTokens_1 = __values(iTokens), iTokens_1_1 = iTokens_1.next(); !iTokens_1_1.done; iTokens_1_1 = iTokens_1.next()) {
124
+ iToken = iTokens_1_1.value;
125
+ iCoin = (0, functions_2.harvestPerUserShare)(tx, iToken, {
126
+ version: __1.STAKE_POOL_VERSION,
127
+ registry: __1.STAKE_POOL,
128
+ index: BigInt(0),
129
+ userShareId: BigInt(input.userShareId),
130
+ clock: constants_1.CLOCK,
131
+ });
132
+ tx.transferObjects([iCoin], input.user);
133
+ }
134
+ }
135
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
136
+ finally {
137
+ try {
138
+ if (iTokens_1_1 && !iTokens_1_1.done && (_d = iTokens_1.return)) _d.call(iTokens_1);
139
+ }
140
+ finally { if (e_2) throw e_2.error; }
141
+ }
131
142
  }
143
+ cToken = constants_1.tokenType[__1.NETWORK][input.cTOKEN];
132
144
  lpCoin = (0, functions_1.mintLp)(tx, [cToken, __1.TLP_TOKEN], {
133
145
  version: __1.PERP_VERSION,
134
146
  registry: __1.LP_POOL,
135
147
  treasuryCaps: __1.TLP_TREASURY_CAP,
136
148
  index: BigInt(0),
137
- pythState: utils_1.pythStateId[__1.NETWORK],
138
- oracle: utils_1.priceInfoObjectIds[__1.NETWORK][input.cTOKEN],
149
+ oracle: constants_1.oracle[__1.NETWORK][input.cTOKEN],
139
150
  coin: coin,
140
151
  clock: constants_1.CLOCK,
141
152
  });
@@ -154,48 +165,57 @@ function mintStakeLp(config, tx, pythClient, input) {
154
165
  }
155
166
  function unstakeBurn(config, tx, pythClient, input) {
156
167
  return __awaiter(this, void 0, void 0, function () {
157
- var tokens, cToken, oracle, tokens_2, tokens_2_1, token, iToken, iCoin, lpCoin, coin;
158
- var e_2, _a;
159
- return __generator(this, function (_b) {
160
- switch (_b.label) {
168
+ var tokens, tokens_2, tokens_2_1, token, iTokens, iTokens_2, iTokens_2_1, iToken, iCoin, lpCoin, cToken, coin;
169
+ var e_3, _a, e_4, _b;
170
+ return __generator(this, function (_c) {
171
+ switch (_c.label) {
161
172
  case 0:
162
173
  tokens = input.lpPool.tokenPools.map(function (p) { return (0, constants_1.typeArgToAsset)("0x" + p.tokenType.name); });
163
174
  return [4 /*yield*/, (0, utils_1.updatePyth)(pythClient, tx, tokens)];
164
175
  case 1:
165
- _b.sent();
166
- cToken = constants_1.tokenType[__1.NETWORK][input.cTOKEN];
167
- oracle = utils_1.priceInfoObjectIds[__1.NETWORK][input.cTOKEN];
176
+ _c.sent();
168
177
  try {
169
178
  for (tokens_2 = __values(tokens), tokens_2_1 = tokens_2.next(); !tokens_2_1.done; tokens_2_1 = tokens_2.next()) {
170
179
  token = tokens_2_1.value;
180
+ (0, utils_1.updateOracleWithPythUsd)(pythClient, tx, config.package.oracle, token);
171
181
  (0, functions_1.updateLiquidityValue)(tx, constants_1.tokenType[__1.NETWORK][token], {
172
182
  version: __1.PERP_VERSION,
173
183
  registry: __1.LP_POOL,
174
184
  index: BigInt(0),
175
- pythState: utils_1.pythStateId[__1.NETWORK],
176
- oracle: utils_1.priceInfoObjectIds[__1.NETWORK][token],
185
+ oracle: constants_1.oracle[__1.NETWORK][token],
177
186
  clock: constants_1.CLOCK,
178
187
  });
179
188
  }
180
189
  }
181
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
190
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
182
191
  finally {
183
192
  try {
184
193
  if (tokens_2_1 && !tokens_2_1.done && (_a = tokens_2.return)) _a.call(tokens_2);
185
194
  }
186
- finally { if (e_2) throw e_2.error; }
195
+ finally { if (e_3) throw e_3.error; }
187
196
  }
188
- iToken = constants_1.tokenType[__1.NETWORK][input.iTOKEN];
189
- // console.log(iToken);
190
197
  if (input.userShareId) {
191
- iCoin = (0, functions_2.harvestPerUserShare)(tx, iToken, {
192
- version: __1.STAKE_POOL_VERSION,
193
- registry: __1.STAKE_POOL,
194
- index: BigInt(0),
195
- userShareId: BigInt(input.userShareId),
196
- clock: constants_1.CLOCK,
197
- });
198
- tx.transferObjects([iCoin], input.user);
198
+ iTokens = input.stakePool.incentives.map(function (i) { return i.tokenType.name; });
199
+ try {
200
+ for (iTokens_2 = __values(iTokens), iTokens_2_1 = iTokens_2.next(); !iTokens_2_1.done; iTokens_2_1 = iTokens_2.next()) {
201
+ iToken = iTokens_2_1.value;
202
+ iCoin = (0, functions_2.harvestPerUserShare)(tx, iToken, {
203
+ version: __1.STAKE_POOL_VERSION,
204
+ registry: __1.STAKE_POOL,
205
+ index: BigInt(0),
206
+ userShareId: BigInt(input.userShareId),
207
+ clock: constants_1.CLOCK,
208
+ });
209
+ tx.transferObjects([iCoin], input.user);
210
+ }
211
+ }
212
+ catch (e_4_1) { e_4 = { error: e_4_1 }; }
213
+ finally {
214
+ try {
215
+ if (iTokens_2_1 && !iTokens_2_1.done && (_b = iTokens_2.return)) _b.call(iTokens_2);
216
+ }
217
+ finally { if (e_4) throw e_4.error; }
218
+ }
199
219
  }
200
220
  lpCoin = (0, functions_2.unstake)(tx, __1.TLP_TOKEN, {
201
221
  version: __1.STAKE_POOL_VERSION,
@@ -203,15 +223,14 @@ function unstakeBurn(config, tx, pythClient, input) {
203
223
  index: BigInt(0),
204
224
  userShareId: BigInt(input.userShareId),
205
225
  clock: constants_1.CLOCK,
206
- unstakedShares: input.share ? BigInt(input.share) : null,
207
226
  });
227
+ cToken = constants_1.tokenType[__1.NETWORK][input.cTOKEN];
208
228
  coin = (0, functions_1.burnLp)(tx, [cToken, __1.TLP_TOKEN], {
209
229
  version: __1.PERP_VERSION,
210
230
  registry: __1.LP_POOL,
211
231
  treasuryCaps: __1.TLP_TREASURY_CAP,
212
232
  index: BigInt(0),
213
- pythState: utils_1.pythStateId[__1.NETWORK],
214
- oracle: oracle,
233
+ oracle: constants_1.oracle[__1.NETWORK][input.cTOKEN],
215
234
  coin: lpCoin,
216
235
  clock: constants_1.CLOCK,
217
236
  });
@@ -223,15 +242,15 @@ function unstakeBurn(config, tx, pythClient, input) {
223
242
  }
224
243
  function swap(config, tx, pythClient, input) {
225
244
  return __awaiter(this, void 0, void 0, function () {
226
- var fromToken, toToken, coin, destination, token;
245
+ var coin, destination, fromToken, toToken, token;
227
246
  var _a, _b;
228
247
  return __generator(this, function (_c) {
229
248
  switch (_c.label) {
230
249
  case 0: return [4 /*yield*/, (0, utils_1.updatePyth)(pythClient, tx, [input.FROM_TOKEN, input.TO_TOKEN])];
231
250
  case 1:
232
251
  _c.sent();
233
- fromToken = constants_1.tokenType[__1.NETWORK][input.FROM_TOKEN];
234
- toToken = constants_1.tokenType[__1.NETWORK][input.TO_TOKEN];
252
+ (0, utils_1.updateOracleWithPythUsd)(pythClient, tx, config.package.oracle, input.FROM_TOKEN);
253
+ (0, utils_1.updateOracleWithPythUsd)(pythClient, tx, config.package.oracle, input.TO_TOKEN);
235
254
  if (input.FROM_TOKEN == "SUI") {
236
255
  _a = __read(tx.splitCoins(tx.gas, [input.amount]), 1), coin = _a[0];
237
256
  }
@@ -242,14 +261,15 @@ function swap(config, tx, pythClient, input) {
242
261
  }
243
262
  _b = __read(tx.splitCoins(destination, [input.amount]), 1), coin = _b[0];
244
263
  }
264
+ fromToken = constants_1.tokenType[__1.NETWORK][input.FROM_TOKEN];
265
+ toToken = constants_1.tokenType[__1.NETWORK][input.TO_TOKEN];
245
266
  token = (0, functions_1.swap)(tx, [fromToken, toToken], {
246
267
  version: __1.PERP_VERSION,
247
268
  registry: __1.LP_POOL,
248
- pythState: utils_1.pythStateId[__1.NETWORK],
249
269
  clock: constants_1.CLOCK,
250
270
  index: BigInt(0),
251
- oracleFromToken: utils_1.priceInfoObjectIds[__1.NETWORK][input.FROM_TOKEN],
252
- oracleToToken: utils_1.priceInfoObjectIds[__1.NETWORK][input.TO_TOKEN],
271
+ oracleFromToken: constants_1.oracle[__1.NETWORK][input.FROM_TOKEN],
272
+ oracleToToken: constants_1.oracle[__1.NETWORK][input.TO_TOKEN],
253
273
  fromCoin: coin,
254
274
  minToAmount: BigInt(0),
255
275
  });
@@ -276,17 +296,30 @@ function unsubscribe(config, tx, input) {
276
296
  }
277
297
  function harvestStakeReward(config, tx, input) {
278
298
  return __awaiter(this, void 0, void 0, function () {
279
- var iToken, iCoin;
280
- return __generator(this, function (_a) {
281
- iToken = constants_1.tokenType[__1.NETWORK][input.iTOKEN];
282
- iCoin = (0, functions_2.harvestPerUserShare)(tx, iToken, {
283
- version: __1.STAKE_POOL_VERSION,
284
- registry: __1.STAKE_POOL,
285
- index: BigInt(0),
286
- userShareId: BigInt(input.userShareId),
287
- clock: constants_1.CLOCK,
288
- });
289
- tx.transferObjects([iCoin], input.user);
299
+ var iTokens, iTokens_3, iTokens_3_1, iToken, iCoin;
300
+ var e_5, _a;
301
+ return __generator(this, function (_b) {
302
+ iTokens = input.stakePool.incentives.map(function (i) { return i.tokenType.name; });
303
+ try {
304
+ for (iTokens_3 = __values(iTokens), iTokens_3_1 = iTokens_3.next(); !iTokens_3_1.done; iTokens_3_1 = iTokens_3.next()) {
305
+ iToken = iTokens_3_1.value;
306
+ iCoin = (0, functions_2.harvestPerUserShare)(tx, iToken, {
307
+ version: __1.STAKE_POOL_VERSION,
308
+ registry: __1.STAKE_POOL,
309
+ index: BigInt(0),
310
+ userShareId: BigInt(input.userShareId),
311
+ clock: constants_1.CLOCK,
312
+ });
313
+ tx.transferObjects([iCoin], input.user);
314
+ }
315
+ }
316
+ catch (e_5_1) { e_5 = { error: e_5_1 }; }
317
+ finally {
318
+ try {
319
+ if (iTokens_3_1 && !iTokens_3_1.done && (_a = iTokens_3.return)) _a.call(iTokens_3);
320
+ }
321
+ finally { if (e_5) throw e_5.error; }
322
+ }
290
323
  return [2 /*return*/, tx];
291
324
  });
292
325
  });
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@typus/typus-perp-sdk",
3
- "version": "1.0.20",
3
+ "version": "1.0.21-tk1",
4
4
  "repository": "https://github.com/Typus-Lab/typus-perp-sdk.git",
5
5
  "author": "Typus",
6
6
  "description": "typus perp sdk",
7
7
  "license": "MIT",
8
8
  "dependencies": {
9
- "@typus/typus-sdk": "1.6.1"
9
+ "@typus/typus-sdk": "1.6.4-tk3"
10
10
  },
11
11
  "devDependencies": {
12
12
  "@types/bs58": "^4.0.1",
@@ -1,13 +0,0 @@
1
- import { Transaction, TransactionArgument, TransactionObjectInput } from "@mysten/sui/transactions";
2
- export interface GetPriceArgs {
3
- state: TransactionObjectInput;
4
- priceInfoObject: TransactionObjectInput;
5
- clock: TransactionObjectInput;
6
- }
7
- export declare function getPrice(tx: Transaction, args: GetPriceArgs): import("@mysten/sui/transactions").TransactionResult;
8
- export declare function getEmaPrice(tx: Transaction, priceInfoObject: TransactionObjectInput): import("@mysten/sui/transactions").TransactionResult;
9
- export interface GetPriceInfoObjectIdArgs {
10
- state: TransactionObjectInput;
11
- priceIdentifierBytes: Array<number | TransactionArgument> | TransactionArgument;
12
- }
13
- export declare function getPriceInfoObjectId(tx: Transaction, args: GetPriceInfoObjectIdArgs): import("@mysten/sui/transactions").TransactionResult;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getPrice = getPrice;
4
- exports.getEmaPrice = getEmaPrice;
5
- exports.getPriceInfoObjectId = getPriceInfoObjectId;
6
- var __1 = require("..");
7
- var util_1 = require("../../_framework/util");
8
- function getPrice(tx, args) {
9
- return tx.moveCall({
10
- target: "".concat(__1.PUBLISHED_AT, "::oracle::get_price"),
11
- arguments: [(0, util_1.obj)(tx, args.state), (0, util_1.obj)(tx, args.priceInfoObject), (0, util_1.obj)(tx, args.clock)],
12
- });
13
- }
14
- function getEmaPrice(tx, priceInfoObject) {
15
- return tx.moveCall({ target: "".concat(__1.PUBLISHED_AT, "::oracle::get_ema_price"), arguments: [(0, util_1.obj)(tx, priceInfoObject)] });
16
- }
17
- function getPriceInfoObjectId(tx, args) {
18
- return tx.moveCall({
19
- target: "".concat(__1.PUBLISHED_AT, "::oracle::get_price_info_object_id"),
20
- arguments: [(0, util_1.obj)(tx, args.state), (0, util_1.pure)(tx, args.priceIdentifierBytes, "vector<u8>")],
21
- });
22
- }
@@ -1,111 +0,0 @@
1
- import { ID } from "../../_dependencies/source/0x2/object/structs";
2
- import { PhantomReified, Reified, StructClass, ToField, ToTypeStr } from "../../_framework/reified";
3
- import { FieldsWithTypes } from "../../_framework/util";
4
- import { PKG_V1 } from "../index";
5
- import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
6
- export declare function isPythPrice(type: string): boolean;
7
- export interface PythPriceFields {
8
- price: ToField<"u64">;
9
- conf: ToField<"u64">;
10
- timestamp: ToField<"u64">;
11
- decimal: ToField<"u64">;
12
- }
13
- export type PythPriceReified = Reified<PythPrice, PythPriceFields>;
14
- export declare class PythPrice implements StructClass {
15
- __StructClass: true;
16
- static readonly $typeName: string;
17
- static readonly $numTypeParams = 0;
18
- static readonly $isPhantom: readonly [];
19
- readonly $typeName: string;
20
- readonly $fullTypeName: `${typeof PKG_V1}::oracle::PythPrice`;
21
- readonly $typeArgs: [];
22
- readonly $isPhantom: readonly [];
23
- readonly price: ToField<"u64">;
24
- readonly conf: ToField<"u64">;
25
- readonly timestamp: ToField<"u64">;
26
- readonly decimal: ToField<"u64">;
27
- private constructor();
28
- static reified(): PythPriceReified;
29
- static get r(): import("../../_framework/reified").StructClassReified<PythPrice, PythPriceFields>;
30
- static phantom(): PhantomReified<ToTypeStr<PythPrice>>;
31
- static get p(): PhantomReified<"::oracle::PythPrice" | "0x7c19f81d9d411e78305d7af8dad25317c56bb449fede8a78b6021232478f0509::oracle::PythPrice">;
32
- static get bcs(): import("@mysten/sui/bcs").BcsType<{
33
- price: string;
34
- conf: string;
35
- timestamp: string;
36
- decimal: string;
37
- }, {
38
- price: string | number | bigint;
39
- conf: string | number | bigint;
40
- timestamp: string | number | bigint;
41
- decimal: string | number | bigint;
42
- }>;
43
- static fromFields(fields: Record<string, any>): PythPrice;
44
- static fromFieldsWithTypes(item: FieldsWithTypes): PythPrice;
45
- static fromBcs(data: Uint8Array): PythPrice;
46
- toJSONField(): {
47
- price: string;
48
- conf: string;
49
- timestamp: string;
50
- decimal: string;
51
- };
52
- toJSON(): {
53
- price: string;
54
- conf: string;
55
- timestamp: string;
56
- decimal: string;
57
- $typeName: string;
58
- $typeArgs: [];
59
- };
60
- static fromJSONField(field: any): PythPrice;
61
- static fromJSON(json: Record<string, any>): PythPrice;
62
- static fromSuiParsedData(content: SuiParsedData): PythPrice;
63
- static fromSuiObjectData(data: SuiObjectData): PythPrice;
64
- static fetch(client: SuiClient, id: string): Promise<PythPrice>;
65
- }
66
- export declare function isPythPriceInfoObject(type: string): boolean;
67
- export interface PythPriceInfoObjectFields {
68
- id: ToField<ID>;
69
- }
70
- export type PythPriceInfoObjectReified = Reified<PythPriceInfoObject, PythPriceInfoObjectFields>;
71
- export declare class PythPriceInfoObject implements StructClass {
72
- __StructClass: true;
73
- static readonly $typeName: string;
74
- static readonly $numTypeParams = 0;
75
- static readonly $isPhantom: readonly [];
76
- readonly $typeName: string;
77
- readonly $fullTypeName: `${typeof PKG_V1}::oracle::PythPriceInfoObject`;
78
- readonly $typeArgs: [];
79
- readonly $isPhantom: readonly [];
80
- readonly id: ToField<ID>;
81
- private constructor();
82
- static reified(): PythPriceInfoObjectReified;
83
- static get r(): import("../../_framework/reified").StructClassReified<PythPriceInfoObject, PythPriceInfoObjectFields>;
84
- static phantom(): PhantomReified<ToTypeStr<PythPriceInfoObject>>;
85
- static get p(): PhantomReified<"::oracle::PythPriceInfoObject" | "0x7c19f81d9d411e78305d7af8dad25317c56bb449fede8a78b6021232478f0509::oracle::PythPriceInfoObject">;
86
- static get bcs(): import("@mysten/sui/bcs").BcsType<{
87
- id: {
88
- bytes: string;
89
- };
90
- }, {
91
- id: {
92
- bytes: string;
93
- };
94
- }>;
95
- static fromFields(fields: Record<string, any>): PythPriceInfoObject;
96
- static fromFieldsWithTypes(item: FieldsWithTypes): PythPriceInfoObject;
97
- static fromBcs(data: Uint8Array): PythPriceInfoObject;
98
- toJSONField(): {
99
- id: string;
100
- };
101
- toJSON(): {
102
- id: string;
103
- $typeName: string;
104
- $typeArgs: [];
105
- };
106
- static fromJSONField(field: any): PythPriceInfoObject;
107
- static fromJSON(json: Record<string, any>): PythPriceInfoObject;
108
- static fromSuiParsedData(content: SuiParsedData): PythPriceInfoObject;
109
- static fromSuiObjectData(data: SuiObjectData): PythPriceInfoObject;
110
- static fetch(client: SuiClient, id: string): Promise<PythPriceInfoObject>;
111
- }