@typus/typus-sdk 1.8.41 → 1.8.43-upgrade

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 (50) hide show
  1. package/dist/src/auto-bid/view-function.d.ts +0 -2
  2. package/dist/src/auto-bid/view-function.js +7 -76
  3. package/dist/src/constants/constant.d.ts +0 -3
  4. package/dist/src/constants/constant.js +1 -8
  5. package/dist/src/constants/token.d.ts +1 -1
  6. package/dist/src/constants/token.js +12 -0
  7. package/dist/src/dice/fetch.d.ts +0 -4
  8. package/dist/src/dice/fetch.js +59 -116
  9. package/dist/src/typus/airdrop/view-function.js +5 -8
  10. package/dist/src/typus/leaderboard/view-function.js +5 -8
  11. package/dist/src/typus/tails-staking/view-function.js +10 -14
  12. package/dist/src/typus/user/view-function.js +5 -6
  13. package/dist/src/typus-dov-single-v2/function/bidding.d.ts +4 -3
  14. package/dist/src/typus-dov-single-v2/function/bidding.js +10 -11
  15. package/dist/src/typus-dov-single-v2/function/token.js +1 -1
  16. package/dist/src/typus-dov-single-v2/history/index.d.ts +0 -1
  17. package/dist/src/typus-dov-single-v2/history/index.js +0 -1
  18. package/dist/src/typus-dov-single-v2/history/user-history.d.ts +2 -3
  19. package/dist/src/typus-dov-single-v2/history/user-history.js +122 -184
  20. package/dist/src/typus-dov-single-v2/otc-entry.js +5 -6
  21. package/dist/src/typus-dov-single-v2/user-entry.d.ts +1 -1
  22. package/dist/src/typus-dov-single-v2/view-function.js +29 -27
  23. package/dist/src/typus-hedge/view-function.js +10 -10
  24. package/dist/src/typus-launch/airdrop/view-function.js +3 -5
  25. package/dist/src/typus-launch/auction/view-function.js +17 -16
  26. package/dist/src/typus-launch/funding-vault/view-function.js +20 -18
  27. package/dist/src/typus-launch/improvement-proposal/view-function.js +17 -18
  28. package/dist/src/typus-launch/ve-typus/view-function.js +15 -15
  29. package/dist/src/typus-safu/view-function.js +13 -13
  30. package/dist/src/utils/api/price.js +1 -1
  31. package/dist/src/utils/graphQl.d.ts +24 -0
  32. package/dist/src/utils/graphQl.js +129 -0
  33. package/dist/src/utils/index.d.ts +1 -0
  34. package/dist/src/utils/index.js +1 -0
  35. package/dist/src/utils/oracle.js +13 -14
  36. package/dist/src/utils/pyth/constant.js +4 -0
  37. package/dist/src/utils/sponsoredTx.d.ts +2 -2
  38. package/dist/src/utils/typusConfig.d.ts +4 -0
  39. package/dist/src/utils/typusConfig.js +33 -31
  40. package/package.json +9 -10
  41. package/dist/src/dice/view-function.d.ts +0 -1
  42. package/dist/src/dice/view-function.js +0 -20
  43. package/dist/src/typus-dov-single-v2/history/vault-history.d.ts +0 -123
  44. package/dist/src/typus-dov-single-v2/history/vault-history.js +0 -307
  45. package/dist/src/typus-nft/fetch.d.ts +0 -70
  46. package/dist/src/typus-nft/fetch.js +0 -631
  47. package/dist/src/typus-nft/index.d.ts +0 -2
  48. package/dist/src/typus-nft/index.js +0 -18
  49. package/dist/src/typus-nft/user-entry.d.ts +0 -57
  50. package/dist/src/typus-nft/user-entry.js +0 -161
@@ -84,7 +84,6 @@ var utils_1 = require("../../../src/utils");
84
84
  var auto_bid_1 = require("../../../src/auto-bid");
85
85
  var lodash_1 = require("lodash");
86
86
  var token_1 = require("./token");
87
- var client_1 = require("@mysten/sui/client");
88
87
  var constants_1 = require("../../../src/constants");
89
88
  var bignumber_js_1 = __importDefault(require("bignumber.js"));
90
89
  var moment_1 = __importDefault(require("moment"));
@@ -401,30 +400,30 @@ var parseBid = function (bidVaultInfo, bidShare, auction, oTokenPrice, isAutoBid
401
400
  exports.parseBid = parseBid;
402
401
  function getUserOwnedObjects(config, user) {
403
402
  return __awaiter(this, void 0, void 0, function () {
404
- var provider, result, hasNextPage, data, nextCursor;
403
+ var provider, result, hasNextPage, data, cursor;
405
404
  return __generator(this, function (_a) {
406
405
  switch (_a.label) {
407
406
  case 0:
408
- provider = new client_1.SuiClient({ url: config.rpcEndpoint });
409
- return [4 /*yield*/, provider.getOwnedObjects({ owner: user, options: { showType: true, showContent: true } })];
407
+ provider = config.gRpcClient();
408
+ return [4 /*yield*/, provider.listOwnedObjects({ owner: user, include: { content: true } })];
410
409
  case 1:
411
410
  result = _a.sent();
412
411
  hasNextPage = result.hasNextPage;
413
- data = result.data;
414
- nextCursor = result.nextCursor;
412
+ data = result.objects;
413
+ cursor = result.cursor;
415
414
  _a.label = 2;
416
415
  case 2:
417
416
  if (!hasNextPage) return [3 /*break*/, 4];
418
- return [4 /*yield*/, provider.getOwnedObjects({
417
+ return [4 /*yield*/, provider.listOwnedObjects({
419
418
  owner: user,
420
- cursor: nextCursor,
421
- options: { showType: true, showContent: true },
419
+ cursor: cursor,
420
+ include: { content: true },
422
421
  })];
423
422
  case 3:
424
423
  result = _a.sent();
425
- data = __spreadArray(__spreadArray([], __read(data), false), __read(result.data), false);
424
+ data = __spreadArray(__spreadArray([], __read(data), false), __read(result.objects), false);
426
425
  hasNextPage = result.hasNextPage;
427
- nextCursor = result.nextCursor;
426
+ cursor = result.cursor;
428
427
  return [3 /*break*/, 2];
429
428
  case 4: return [2 /*return*/, data];
430
429
  }
@@ -37,6 +37,6 @@ var getTokenName = function (_a) {
37
37
  else {
38
38
  tokenName = (_c = exports.UnwrappedToken[token]) !== null && _c !== void 0 ? _c : token;
39
39
  }
40
- return million ? (_d = exports.MillionToken[tokenName]) !== null && _d !== void 0 ? _d : tokenName : (_e = exports.RemoveMillionToken[tokenName]) !== null && _e !== void 0 ? _e : tokenName;
40
+ return million ? ((_d = exports.MillionToken[tokenName]) !== null && _d !== void 0 ? _d : tokenName) : ((_e = exports.RemoveMillionToken[tokenName]) !== null && _e !== void 0 ? _e : tokenName);
41
41
  };
42
42
  exports.getTokenName = getTokenName;
@@ -1,2 +1 @@
1
1
  export * from "./user-history";
2
- export * from "./vault-history";
@@ -15,4 +15,3 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./user-history"), exports);
18
- __exportStar(require("./vault-history"), exports);
@@ -1,9 +1,8 @@
1
- import { EventId, SuiClient, SuiEvent } from "@mysten/sui/client";
2
1
  import { Vault } from "../../../src/typus-dov-single-v2";
3
2
  import { TOKEN } from "../../../src/constants";
4
3
  export { getNewBidFromSentio, getExerciseFromSentio } from "../../../src/utils/api/sentio/events";
5
- export declare function getUserEvents(provider: SuiClient, sender: string, cursor?: EventId | null): Promise<[SuiEvent[], EventId | null | undefined]>;
6
- export declare function getAutoBidEvents(provider: SuiClient, originPackage: string, startTimeMs: number): Promise<SuiEvent[]>;
4
+ import { SuiGraphQLClient } from "@mysten/sui/graphql";
5
+ export declare function getUserEvents(graphQlClient: SuiGraphQLClient, sender: string, cursor?: string | null): Promise<import("../../../src/utils/graphQl").Event[]>;
7
6
  export interface TxHistory {
8
7
  Index: string | undefined;
9
8
  Action: string | undefined;