@typus/typus-perp-sdk 1.0.50 → 1.0.52-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 (112) hide show
  1. package/dist/src/_dependencies/source/0x2/bag/structs.d.ts +61 -0
  2. package/dist/src/_dependencies/source/0x2/bag/structs.js +229 -0
  3. package/dist/src/_dependencies/source/0x2/balance/structs.d.ts +88 -0
  4. package/dist/src/_dependencies/source/0x2/balance/structs.js +386 -0
  5. package/dist/src/_dependencies/source/0x2/coin/structs.d.ts +460 -0
  6. package/dist/src/_dependencies/source/0x2/coin/structs.js +1247 -0
  7. package/dist/src/_dependencies/source/0x2/linked-table/structs.d.ts +153 -0
  8. package/dist/src/_dependencies/source/0x2/linked-table/structs.js +438 -0
  9. package/dist/src/_dependencies/source/0x2/sui/structs.d.ts +46 -0
  10. package/dist/src/_dependencies/source/0x2/sui/structs.js +222 -0
  11. package/dist/src/_dependencies/source/0x2/table/structs.d.ts +61 -0
  12. package/dist/src/_dependencies/source/0x2/table/structs.js +248 -0
  13. package/dist/src/_dependencies/source/0x2/table-vec/structs.d.ts +68 -0
  14. package/dist/src/_dependencies/source/0x2/table-vec/structs.js +274 -0
  15. package/dist/src/_dependencies/source/0x2/token/structs.d.ts +449 -0
  16. package/dist/src/_dependencies/source/0x2/token/structs.js +1095 -0
  17. package/dist/src/_dependencies/source/0x2/transfer-policy/structs.d.ts +370 -0
  18. package/dist/src/_dependencies/source/0x2/transfer-policy/structs.js +1091 -0
  19. package/dist/src/_dependencies/source/0x2/url/structs.d.ts +53 -0
  20. package/dist/src/_dependencies/source/0x2/url/structs.js +223 -0
  21. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/airdrop/structs.d.ts +489 -0
  22. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/airdrop/structs.js +1084 -0
  23. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/big-vector/structs.d.ts +147 -0
  24. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/big-vector/structs.js +456 -0
  25. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/critbit/structs.d.ts +239 -0
  26. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/critbit/structs.js +653 -0
  27. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/ecosystem/structs.d.ts +405 -0
  28. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/ecosystem/structs.js +899 -0
  29. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/index.d.ts +8 -0
  30. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/index.js +11 -0
  31. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/init.d.ts +2 -0
  32. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/init.js +102 -0
  33. package/dist/src/_dependencies/source/{0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277 → 0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a}/keyed-big-vector/structs.d.ts +70 -70
  34. package/dist/src/_dependencies/source/{0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277 → 0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a}/keyed-big-vector/structs.js +174 -174
  35. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/leaderboard/structs.d.ts +699 -0
  36. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/leaderboard/structs.js +1459 -0
  37. package/dist/src/_dependencies/source/{0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277 → 0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a}/linked-object-table/structs.d.ts +62 -62
  38. package/dist/src/_dependencies/source/{0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277 → 0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a}/linked-object-table/structs.js +170 -170
  39. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-set/structs.d.ts +147 -0
  40. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-set/structs.js +430 -0
  41. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tails-staking/structs.d.ts +1071 -0
  42. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tails-staking/structs.js +2261 -0
  43. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tgld/structs.d.ts +279 -0
  44. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tgld/structs.js +733 -0
  45. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/user/structs.d.ts +328 -0
  46. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/user/structs.js +892 -0
  47. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/authority/structs.d.ts +88 -0
  48. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/authority/structs.js +263 -0
  49. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/balance-pool/structs.d.ts +347 -0
  50. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/balance-pool/structs.js +591 -0
  51. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/big-vector/structs.d.ts +73 -0
  52. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/big-vector/structs.js +258 -0
  53. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/dutch/structs.d.ts +876 -0
  54. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/dutch/structs.js +1721 -0
  55. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/i64/structs.d.ts +46 -0
  56. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/i64/structs.js +222 -0
  57. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/index.d.ts +3 -0
  58. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/index.js +6 -0
  59. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/init.d.ts +2 -0
  60. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/init.js +89 -0
  61. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/linked-list/structs.d.ts +155 -0
  62. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/linked-list/structs.js +444 -0
  63. package/dist/src/_dependencies/source/{0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded → 0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274}/vault/structs.d.ts +84 -84
  64. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/discount-mint/structs.d.ts +446 -0
  65. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/discount-mint/structs.js +844 -0
  66. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/index.d.ts +6 -0
  67. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/index.js +9 -0
  68. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/init.d.ts +2 -0
  69. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/init.js +69 -0
  70. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/royalty-rule/structs.d.ts +94 -0
  71. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/royalty-rule/structs.js +376 -0
  72. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/staking/structs.d.ts +454 -0
  73. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/staking/structs.js +881 -0
  74. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/table-vec/structs.d.ts +68 -0
  75. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/table-vec/structs.js +274 -0
  76. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/typus-nft/structs.d.ts +1117 -0
  77. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/typus-nft/structs.js +2387 -0
  78. package/dist/src/api/sentio.js +4 -1
  79. package/dist/src/fetch.d.ts +1 -1
  80. package/dist/src/fetch.js +1 -1
  81. package/dist/src/index.js +17 -17
  82. package/dist/src/typus_perp/admin/structs.d.ts +67 -5
  83. package/dist/src/typus_perp/admin/structs.js +155 -1
  84. package/dist/src/typus_perp/escrow/functions.js +1 -1
  85. package/dist/src/typus_perp/escrow/structs.d.ts +2 -2
  86. package/dist/src/typus_perp/escrow/structs.js +1 -1
  87. package/dist/src/typus_perp/lp-pool/structs.d.ts +28 -28
  88. package/dist/src/typus_perp/position/functions.js +1 -1
  89. package/dist/src/typus_perp/position/structs.d.ts +6 -6
  90. package/dist/src/typus_perp/symbol/structs.d.ts +1 -1
  91. package/dist/src/typus_perp/tlp/structs.d.ts +2 -2
  92. package/dist/src/typus_perp/trading/functions.js +1 -1
  93. package/dist/src/typus_perp/trading/structs.d.ts +32 -32
  94. package/dist/src/typus_perp/trading/structs.js +2 -2
  95. package/dist/src/typus_perp/treasury-caps/structs.d.ts +1 -1
  96. package/dist/src/typus_stake_pool/admin/functions.d.ts +25 -25
  97. package/dist/src/typus_stake_pool/admin/functions.js +66 -53
  98. package/dist/src/typus_stake_pool/admin/structs.d.ts +191 -191
  99. package/dist/src/typus_stake_pool/admin/structs.js +179 -179
  100. package/dist/src/typus_stake_pool/stake-pool/functions.d.ts +50 -44
  101. package/dist/src/typus_stake_pool/stake-pool/functions.js +127 -88
  102. package/dist/src/typus_stake_pool/stake-pool/structs.d.ts +202 -202
  103. package/dist/src/typus_stake_pool/stake-pool/structs.js +432 -432
  104. package/dist/src/user/history.js +7 -1
  105. package/package.json +1 -1
  106. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/index.d.ts +0 -8
  107. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/index.js +0 -11
  108. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/index.d.ts +0 -3
  109. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/index.js +0 -6
  110. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/index.d.ts +0 -3
  111. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/index.js +0 -6
  112. /package/dist/src/_dependencies/source/{0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded → 0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274}/vault/structs.js +0 -0
@@ -0,0 +1,88 @@
1
+ import * as reified from "../../../../_framework/reified";
2
+ import { PhantomReified, Reified, StructClass, ToField, ToTypeStr } from "../../../../_framework/reified";
3
+ import { FieldsWithTypes } from "../../../../_framework/util";
4
+ import { LinkedTable } from "../../0x2/linked-table/structs";
5
+ import { PKG_V1 } from "../index";
6
+ import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
7
+ export declare function isAuthority(type: string): boolean;
8
+ export interface AuthorityFields {
9
+ whitelist: ToField<LinkedTable<"address", "bool">>;
10
+ }
11
+ export type AuthorityReified = Reified<Authority, AuthorityFields>;
12
+ export declare class Authority implements StructClass {
13
+ __StructClass: true;
14
+ static readonly $typeName = "0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274::authority::Authority";
15
+ static readonly $numTypeParams = 0;
16
+ static readonly $isPhantom: readonly [];
17
+ readonly $typeName = "0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274::authority::Authority";
18
+ readonly $fullTypeName: `${typeof PKG_V1}::authority::Authority`;
19
+ readonly $typeArgs: [];
20
+ readonly $isPhantom: readonly [];
21
+ readonly whitelist: ToField<LinkedTable<"address", "bool">>;
22
+ private constructor();
23
+ static reified(): AuthorityReified;
24
+ static get r(): reified.StructClassReified<Authority, AuthorityFields>;
25
+ static phantom(): PhantomReified<ToTypeStr<Authority>>;
26
+ static get p(): reified.PhantomReified<"0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274::authority::Authority">;
27
+ static get bcs(): import("@mysten/sui/bcs").BcsType<{
28
+ whitelist: {
29
+ id: {
30
+ id: {
31
+ bytes: string;
32
+ };
33
+ };
34
+ size: string;
35
+ head: {
36
+ vec: any[];
37
+ };
38
+ tail: {
39
+ vec: any[];
40
+ };
41
+ };
42
+ }, {
43
+ whitelist: {
44
+ id: {
45
+ id: {
46
+ bytes: string;
47
+ };
48
+ };
49
+ size: string | number | bigint;
50
+ head: {
51
+ vec: Iterable<any> & {
52
+ length: number;
53
+ };
54
+ };
55
+ tail: {
56
+ vec: Iterable<any> & {
57
+ length: number;
58
+ };
59
+ };
60
+ };
61
+ }>;
62
+ static fromFields(fields: Record<string, any>): Authority;
63
+ static fromFieldsWithTypes(item: FieldsWithTypes): Authority;
64
+ static fromBcs(data: Uint8Array): Authority;
65
+ toJSONField(): {
66
+ whitelist: {
67
+ id: string;
68
+ size: string;
69
+ head: string | null;
70
+ tail: string | null;
71
+ };
72
+ };
73
+ toJSON(): {
74
+ whitelist: {
75
+ id: string;
76
+ size: string;
77
+ head: string | null;
78
+ tail: string | null;
79
+ };
80
+ $typeName: string;
81
+ $typeArgs: [];
82
+ };
83
+ static fromJSONField(field: any): Authority;
84
+ static fromJSON(json: Record<string, any>): Authority;
85
+ static fromSuiParsedData(content: SuiParsedData): Authority;
86
+ static fromSuiObjectData(data: SuiObjectData): Authority;
87
+ static fetch(client: SuiClient, id: string): Promise<Authority>;
88
+ }
@@ -0,0 +1,263 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || (function () {
30
+ var ownKeys = function(o) {
31
+ ownKeys = Object.getOwnPropertyNames || function (o) {
32
+ var ar = [];
33
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
34
+ return ar;
35
+ };
36
+ return ownKeys(o);
37
+ };
38
+ return function (mod) {
39
+ if (mod && mod.__esModule) return mod;
40
+ var result = {};
41
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
42
+ __setModuleDefault(result, mod);
43
+ return result;
44
+ };
45
+ })();
46
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
47
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
48
+ return new (P || (P = Promise))(function (resolve, reject) {
49
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
50
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
51
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
52
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
53
+ });
54
+ };
55
+ var __generator = (this && this.__generator) || function (thisArg, body) {
56
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
57
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
58
+ function verb(n) { return function (v) { return step([n, v]); }; }
59
+ function step(op) {
60
+ if (f) throw new TypeError("Generator is already executing.");
61
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
62
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
63
+ if (y = 0, t) op = [op[0] & 2, t.value];
64
+ switch (op[0]) {
65
+ case 0: case 1: t = op; break;
66
+ case 4: _.label++; return { value: op[1], done: false };
67
+ case 5: _.label++; y = op[1]; op = [0]; continue;
68
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
69
+ default:
70
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
71
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
72
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
73
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
74
+ if (t[2]) _.ops.pop();
75
+ _.trys.pop(); continue;
76
+ }
77
+ op = body.call(thisArg, _);
78
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
79
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
80
+ }
81
+ };
82
+ var __read = (this && this.__read) || function (o, n) {
83
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
84
+ if (!m) return o;
85
+ var i = m.call(o), r, ar = [], e;
86
+ try {
87
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
88
+ }
89
+ catch (error) { e = { error: error }; }
90
+ finally {
91
+ try {
92
+ if (r && !r.done && (m = i["return"])) m.call(i);
93
+ }
94
+ finally { if (e) throw e.error; }
95
+ }
96
+ return ar;
97
+ };
98
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
99
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
100
+ if (ar || !(i in from)) {
101
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
102
+ ar[i] = from[i];
103
+ }
104
+ }
105
+ return to.concat(ar || Array.prototype.slice.call(from));
106
+ };
107
+ Object.defineProperty(exports, "__esModule", { value: true });
108
+ exports.Authority = void 0;
109
+ exports.isAuthority = isAuthority;
110
+ var reified = __importStar(require("../../../../_framework/reified"));
111
+ var reified_1 = require("../../../../_framework/reified");
112
+ var util_1 = require("../../../../_framework/util");
113
+ var structs_1 = require("../../0x2/linked-table/structs");
114
+ var index_1 = require("../index");
115
+ var bcs_1 = require("@mysten/sui/bcs");
116
+ var utils_1 = require("@mysten/sui/utils");
117
+ /* ============================== Authority =============================== */
118
+ function isAuthority(type) {
119
+ type = (0, util_1.compressSuiType)(type);
120
+ return type === "".concat(index_1.PKG_V1, "::authority::Authority");
121
+ }
122
+ var Authority = /** @class */ (function () {
123
+ function Authority(typeArgs, fields) {
124
+ this.__StructClass = true;
125
+ this.$typeName = Authority.$typeName;
126
+ this.$isPhantom = Authority.$isPhantom;
127
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([Authority.$typeName], __read(typeArgs), false));
128
+ this.$typeArgs = typeArgs;
129
+ this.whitelist = fields.whitelist;
130
+ }
131
+ Authority.reified = function () {
132
+ var _this = this;
133
+ return {
134
+ typeName: Authority.$typeName,
135
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([Authority.$typeName], [], false)),
136
+ typeArgs: [],
137
+ isPhantom: Authority.$isPhantom,
138
+ reifiedTypeArgs: [],
139
+ fromFields: function (fields) { return Authority.fromFields(fields); },
140
+ fromFieldsWithTypes: function (item) { return Authority.fromFieldsWithTypes(item); },
141
+ fromBcs: function (data) { return Authority.fromBcs(data); },
142
+ bcs: Authority.bcs,
143
+ fromJSONField: function (field) { return Authority.fromJSONField(field); },
144
+ fromJSON: function (json) { return Authority.fromJSON(json); },
145
+ fromSuiParsedData: function (content) { return Authority.fromSuiParsedData(content); },
146
+ fromSuiObjectData: function (content) { return Authority.fromSuiObjectData(content); },
147
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
148
+ return [2 /*return*/, Authority.fetch(client, id)];
149
+ }); }); },
150
+ new: function (fields) {
151
+ return new Authority([], fields);
152
+ },
153
+ kind: "StructClassReified",
154
+ };
155
+ };
156
+ Object.defineProperty(Authority, "r", {
157
+ get: function () {
158
+ return Authority.reified();
159
+ },
160
+ enumerable: false,
161
+ configurable: true
162
+ });
163
+ Authority.phantom = function () {
164
+ return (0, reified_1.phantom)(Authority.reified());
165
+ };
166
+ Object.defineProperty(Authority, "p", {
167
+ get: function () {
168
+ return Authority.phantom();
169
+ },
170
+ enumerable: false,
171
+ configurable: true
172
+ });
173
+ Object.defineProperty(Authority, "bcs", {
174
+ get: function () {
175
+ return bcs_1.bcs.struct("Authority", {
176
+ whitelist: structs_1.LinkedTable.bcs(bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } })),
177
+ });
178
+ },
179
+ enumerable: false,
180
+ configurable: true
181
+ });
182
+ Authority.fromFields = function (fields) {
183
+ return Authority.reified().new({
184
+ whitelist: (0, reified_1.decodeFromFields)(structs_1.LinkedTable.reified("address", reified.phantom("bool")), fields.whitelist),
185
+ });
186
+ };
187
+ Authority.fromFieldsWithTypes = function (item) {
188
+ if (!isAuthority(item.type)) {
189
+ throw new Error("not a Authority type");
190
+ }
191
+ return Authority.reified().new({
192
+ whitelist: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.LinkedTable.reified("address", reified.phantom("bool")), item.fields.whitelist),
193
+ });
194
+ };
195
+ Authority.fromBcs = function (data) {
196
+ return Authority.fromFields(Authority.bcs.parse(data));
197
+ };
198
+ Authority.prototype.toJSONField = function () {
199
+ return {
200
+ whitelist: this.whitelist.toJSONField(),
201
+ };
202
+ };
203
+ Authority.prototype.toJSON = function () {
204
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
205
+ };
206
+ Authority.fromJSONField = function (field) {
207
+ return Authority.reified().new({
208
+ whitelist: (0, reified_1.decodeFromJSONField)(structs_1.LinkedTable.reified("address", reified.phantom("bool")), field.whitelist),
209
+ });
210
+ };
211
+ Authority.fromJSON = function (json) {
212
+ if (json.$typeName !== Authority.$typeName) {
213
+ throw new Error("not a WithTwoGenerics json object");
214
+ }
215
+ return Authority.fromJSONField(json);
216
+ };
217
+ Authority.fromSuiParsedData = function (content) {
218
+ if (content.dataType !== "moveObject") {
219
+ throw new Error("not an object");
220
+ }
221
+ if (!isAuthority(content.type)) {
222
+ throw new Error("object at ".concat(content.fields.id, " is not a Authority object"));
223
+ }
224
+ return Authority.fromFieldsWithTypes(content);
225
+ };
226
+ Authority.fromSuiObjectData = function (data) {
227
+ if (data.bcs) {
228
+ if (data.bcs.dataType !== "moveObject" || !isAuthority(data.bcs.type)) {
229
+ throw new Error("object at is not a Authority object");
230
+ }
231
+ return Authority.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
232
+ }
233
+ if (data.content) {
234
+ return Authority.fromSuiParsedData(data.content);
235
+ }
236
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
237
+ };
238
+ Authority.fetch = function (client, id) {
239
+ return __awaiter(this, void 0, void 0, function () {
240
+ var res;
241
+ var _a, _b;
242
+ return __generator(this, function (_c) {
243
+ switch (_c.label) {
244
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
245
+ case 1:
246
+ res = _c.sent();
247
+ if (res.error) {
248
+ throw new Error("error fetching Authority object at id ".concat(id, ": ").concat(res.error.code));
249
+ }
250
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isAuthority(res.data.bcs.type)) {
251
+ throw new Error("object at id ".concat(id, " is not a Authority object"));
252
+ }
253
+ return [2 /*return*/, Authority.fromSuiObjectData(res.data)];
254
+ }
255
+ });
256
+ });
257
+ };
258
+ Authority.$typeName = "".concat(index_1.PKG_V1, "::authority::Authority");
259
+ Authority.$numTypeParams = 0;
260
+ Authority.$isPhantom = [];
261
+ return Authority;
262
+ }());
263
+ exports.Authority = Authority;
@@ -0,0 +1,347 @@
1
+ import * as reified from "../../../../_framework/reified";
2
+ import { PhantomReified, Reified, StructClass, ToField, ToTypeStr } from "../../../../_framework/reified";
3
+ import { FieldsWithTypes } from "../../../../_framework/util";
4
+ import { Vector } from "../../../../_framework/vector";
5
+ import { TypeName } from "../../0x1/type-name/structs";
6
+ import { UID } from "../../0x2/object/structs";
7
+ import { Authority } from "../authority/structs";
8
+ import { PKG_V1 } from "../index";
9
+ import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
10
+ export declare function isBalanceInfo(type: string): boolean;
11
+ export interface BalanceInfoFields {
12
+ token: ToField<TypeName>;
13
+ value: ToField<"u64">;
14
+ }
15
+ export type BalanceInfoReified = Reified<BalanceInfo, BalanceInfoFields>;
16
+ export declare class BalanceInfo implements StructClass {
17
+ __StructClass: true;
18
+ static readonly $typeName = "0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274::balance_pool::BalanceInfo";
19
+ static readonly $numTypeParams = 0;
20
+ static readonly $isPhantom: readonly [];
21
+ readonly $typeName = "0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274::balance_pool::BalanceInfo";
22
+ readonly $fullTypeName: `${typeof PKG_V1}::balance_pool::BalanceInfo`;
23
+ readonly $typeArgs: [];
24
+ readonly $isPhantom: readonly [];
25
+ readonly token: ToField<TypeName>;
26
+ readonly value: ToField<"u64">;
27
+ private constructor();
28
+ static reified(): BalanceInfoReified;
29
+ static get r(): reified.StructClassReified<BalanceInfo, BalanceInfoFields>;
30
+ static phantom(): PhantomReified<ToTypeStr<BalanceInfo>>;
31
+ static get p(): reified.PhantomReified<"0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274::balance_pool::BalanceInfo">;
32
+ static get bcs(): import("@mysten/sui/bcs").BcsType<{
33
+ token: {
34
+ name: {
35
+ bytes: number[];
36
+ };
37
+ };
38
+ value: string;
39
+ }, {
40
+ token: {
41
+ name: {
42
+ bytes: Iterable<number> & {
43
+ length: number;
44
+ };
45
+ };
46
+ };
47
+ value: string | number | bigint;
48
+ }>;
49
+ static fromFields(fields: Record<string, any>): BalanceInfo;
50
+ static fromFieldsWithTypes(item: FieldsWithTypes): BalanceInfo;
51
+ static fromBcs(data: Uint8Array): BalanceInfo;
52
+ toJSONField(): {
53
+ token: {
54
+ name: string;
55
+ };
56
+ value: string;
57
+ };
58
+ toJSON(): {
59
+ token: {
60
+ name: string;
61
+ };
62
+ value: string;
63
+ $typeName: string;
64
+ $typeArgs: [];
65
+ };
66
+ static fromJSONField(field: any): BalanceInfo;
67
+ static fromJSON(json: Record<string, any>): BalanceInfo;
68
+ static fromSuiParsedData(content: SuiParsedData): BalanceInfo;
69
+ static fromSuiObjectData(data: SuiObjectData): BalanceInfo;
70
+ static fetch(client: SuiClient, id: string): Promise<BalanceInfo>;
71
+ }
72
+ export declare function isBalancePool(type: string): boolean;
73
+ export interface BalancePoolFields {
74
+ id: ToField<UID>;
75
+ balanceInfos: ToField<Vector<BalanceInfo>>;
76
+ authority: ToField<Authority>;
77
+ }
78
+ export type BalancePoolReified = Reified<BalancePool, BalancePoolFields>;
79
+ export declare class BalancePool implements StructClass {
80
+ __StructClass: true;
81
+ static readonly $typeName = "0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274::balance_pool::BalancePool";
82
+ static readonly $numTypeParams = 0;
83
+ static readonly $isPhantom: readonly [];
84
+ readonly $typeName = "0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274::balance_pool::BalancePool";
85
+ readonly $fullTypeName: `${typeof PKG_V1}::balance_pool::BalancePool`;
86
+ readonly $typeArgs: [];
87
+ readonly $isPhantom: readonly [];
88
+ readonly id: ToField<UID>;
89
+ readonly balanceInfos: ToField<Vector<BalanceInfo>>;
90
+ readonly authority: ToField<Authority>;
91
+ private constructor();
92
+ static reified(): BalancePoolReified;
93
+ static get r(): reified.StructClassReified<BalancePool, BalancePoolFields>;
94
+ static phantom(): PhantomReified<ToTypeStr<BalancePool>>;
95
+ static get p(): reified.PhantomReified<"0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274::balance_pool::BalancePool">;
96
+ static get bcs(): import("@mysten/sui/bcs").BcsType<{
97
+ id: {
98
+ id: {
99
+ bytes: string;
100
+ };
101
+ };
102
+ balance_infos: {
103
+ token: {
104
+ name: {
105
+ bytes: number[];
106
+ };
107
+ };
108
+ value: string;
109
+ }[];
110
+ authority: {
111
+ whitelist: {
112
+ id: {
113
+ id: {
114
+ bytes: string;
115
+ };
116
+ };
117
+ size: string;
118
+ head: {
119
+ vec: any[];
120
+ };
121
+ tail: {
122
+ vec: any[];
123
+ };
124
+ };
125
+ };
126
+ }, {
127
+ id: {
128
+ id: {
129
+ bytes: string;
130
+ };
131
+ };
132
+ balance_infos: Iterable<{
133
+ token: {
134
+ name: {
135
+ bytes: Iterable<number> & {
136
+ length: number;
137
+ };
138
+ };
139
+ };
140
+ value: string | number | bigint;
141
+ }> & {
142
+ length: number;
143
+ };
144
+ authority: {
145
+ whitelist: {
146
+ id: {
147
+ id: {
148
+ bytes: string;
149
+ };
150
+ };
151
+ size: string | number | bigint;
152
+ head: {
153
+ vec: Iterable<any> & {
154
+ length: number;
155
+ };
156
+ };
157
+ tail: {
158
+ vec: Iterable<any> & {
159
+ length: number;
160
+ };
161
+ };
162
+ };
163
+ };
164
+ }>;
165
+ static fromFields(fields: Record<string, any>): BalancePool;
166
+ static fromFieldsWithTypes(item: FieldsWithTypes): BalancePool;
167
+ static fromBcs(data: Uint8Array): BalancePool;
168
+ toJSONField(): {
169
+ id: string;
170
+ balanceInfos: {
171
+ token: {
172
+ name: string;
173
+ };
174
+ value: string;
175
+ }[];
176
+ authority: {
177
+ whitelist: {
178
+ id: string;
179
+ size: string;
180
+ head: string | null;
181
+ tail: string | null;
182
+ };
183
+ };
184
+ };
185
+ toJSON(): {
186
+ id: string;
187
+ balanceInfos: {
188
+ token: {
189
+ name: string;
190
+ };
191
+ value: string;
192
+ }[];
193
+ authority: {
194
+ whitelist: {
195
+ id: string;
196
+ size: string;
197
+ head: string | null;
198
+ tail: string | null;
199
+ };
200
+ };
201
+ $typeName: string;
202
+ $typeArgs: [];
203
+ };
204
+ static fromJSONField(field: any): BalancePool;
205
+ static fromJSON(json: Record<string, any>): BalancePool;
206
+ static fromSuiParsedData(content: SuiParsedData): BalancePool;
207
+ static fromSuiObjectData(data: SuiObjectData): BalancePool;
208
+ static fetch(client: SuiClient, id: string): Promise<BalancePool>;
209
+ }
210
+ export declare function isSharedBalancePool(type: string): boolean;
211
+ export interface SharedBalancePoolFields {
212
+ id: ToField<UID>;
213
+ balanceInfos: ToField<Vector<BalanceInfo>>;
214
+ authority: ToField<Authority>;
215
+ }
216
+ export type SharedBalancePoolReified = Reified<SharedBalancePool, SharedBalancePoolFields>;
217
+ export declare class SharedBalancePool implements StructClass {
218
+ __StructClass: true;
219
+ static readonly $typeName = "0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274::balance_pool::SharedBalancePool";
220
+ static readonly $numTypeParams = 0;
221
+ static readonly $isPhantom: readonly [];
222
+ readonly $typeName = "0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274::balance_pool::SharedBalancePool";
223
+ readonly $fullTypeName: `${typeof PKG_V1}::balance_pool::SharedBalancePool`;
224
+ readonly $typeArgs: [];
225
+ readonly $isPhantom: readonly [];
226
+ readonly id: ToField<UID>;
227
+ readonly balanceInfos: ToField<Vector<BalanceInfo>>;
228
+ readonly authority: ToField<Authority>;
229
+ private constructor();
230
+ static reified(): SharedBalancePoolReified;
231
+ static get r(): reified.StructClassReified<SharedBalancePool, SharedBalancePoolFields>;
232
+ static phantom(): PhantomReified<ToTypeStr<SharedBalancePool>>;
233
+ static get p(): reified.PhantomReified<"0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274::balance_pool::SharedBalancePool">;
234
+ static get bcs(): import("@mysten/sui/bcs").BcsType<{
235
+ id: {
236
+ id: {
237
+ bytes: string;
238
+ };
239
+ };
240
+ balance_infos: {
241
+ token: {
242
+ name: {
243
+ bytes: number[];
244
+ };
245
+ };
246
+ value: string;
247
+ }[];
248
+ authority: {
249
+ whitelist: {
250
+ id: {
251
+ id: {
252
+ bytes: string;
253
+ };
254
+ };
255
+ size: string;
256
+ head: {
257
+ vec: any[];
258
+ };
259
+ tail: {
260
+ vec: any[];
261
+ };
262
+ };
263
+ };
264
+ }, {
265
+ id: {
266
+ id: {
267
+ bytes: string;
268
+ };
269
+ };
270
+ balance_infos: Iterable<{
271
+ token: {
272
+ name: {
273
+ bytes: Iterable<number> & {
274
+ length: number;
275
+ };
276
+ };
277
+ };
278
+ value: string | number | bigint;
279
+ }> & {
280
+ length: number;
281
+ };
282
+ authority: {
283
+ whitelist: {
284
+ id: {
285
+ id: {
286
+ bytes: string;
287
+ };
288
+ };
289
+ size: string | number | bigint;
290
+ head: {
291
+ vec: Iterable<any> & {
292
+ length: number;
293
+ };
294
+ };
295
+ tail: {
296
+ vec: Iterable<any> & {
297
+ length: number;
298
+ };
299
+ };
300
+ };
301
+ };
302
+ }>;
303
+ static fromFields(fields: Record<string, any>): SharedBalancePool;
304
+ static fromFieldsWithTypes(item: FieldsWithTypes): SharedBalancePool;
305
+ static fromBcs(data: Uint8Array): SharedBalancePool;
306
+ toJSONField(): {
307
+ id: string;
308
+ balanceInfos: {
309
+ token: {
310
+ name: string;
311
+ };
312
+ value: string;
313
+ }[];
314
+ authority: {
315
+ whitelist: {
316
+ id: string;
317
+ size: string;
318
+ head: string | null;
319
+ tail: string | null;
320
+ };
321
+ };
322
+ };
323
+ toJSON(): {
324
+ id: string;
325
+ balanceInfos: {
326
+ token: {
327
+ name: string;
328
+ };
329
+ value: string;
330
+ }[];
331
+ authority: {
332
+ whitelist: {
333
+ id: string;
334
+ size: string;
335
+ head: string | null;
336
+ tail: string | null;
337
+ };
338
+ };
339
+ $typeName: string;
340
+ $typeArgs: [];
341
+ };
342
+ static fromJSONField(field: any): SharedBalancePool;
343
+ static fromJSON(json: Record<string, any>): SharedBalancePool;
344
+ static fromSuiParsedData(content: SuiParsedData): SharedBalancePool;
345
+ static fromSuiObjectData(data: SuiObjectData): SharedBalancePool;
346
+ static fetch(client: SuiClient, id: string): Promise<SharedBalancePool>;
347
+ }