@typus/typus-perp-sdk 1.0.52 → 1.0.53-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/fetch.d.ts +1 -1
  79. package/dist/src/fetch.js +1 -1
  80. package/dist/src/index.js +18 -18
  81. package/dist/src/typus_perp/admin/structs.d.ts +67 -5
  82. package/dist/src/typus_perp/admin/structs.js +155 -1
  83. package/dist/src/typus_perp/escrow/functions.js +1 -1
  84. package/dist/src/typus_perp/escrow/structs.d.ts +2 -2
  85. package/dist/src/typus_perp/escrow/structs.js +1 -1
  86. package/dist/src/typus_perp/lp-pool/structs.d.ts +28 -28
  87. package/dist/src/typus_perp/position/functions.js +1 -1
  88. package/dist/src/typus_perp/position/structs.d.ts +6 -6
  89. package/dist/src/typus_perp/symbol/structs.d.ts +1 -1
  90. package/dist/src/typus_perp/tlp/structs.d.ts +2 -2
  91. package/dist/src/typus_perp/trading/functions.js +1 -1
  92. package/dist/src/typus_perp/trading/structs.d.ts +32 -32
  93. package/dist/src/typus_perp/trading/structs.js +2 -2
  94. package/dist/src/typus_perp/treasury-caps/structs.d.ts +1 -1
  95. package/dist/src/typus_stake_pool/admin/functions.d.ts +25 -25
  96. package/dist/src/typus_stake_pool/admin/functions.js +66 -53
  97. package/dist/src/typus_stake_pool/admin/structs.d.ts +191 -191
  98. package/dist/src/typus_stake_pool/admin/structs.js +179 -179
  99. package/dist/src/typus_stake_pool/stake-pool/functions.d.ts +50 -44
  100. package/dist/src/typus_stake_pool/stake-pool/functions.js +127 -88
  101. package/dist/src/typus_stake_pool/stake-pool/structs.d.ts +202 -202
  102. package/dist/src/typus_stake_pool/stake-pool/structs.js +432 -432
  103. package/dist/src/user/history.js +6 -4
  104. package/dist/src/user/order.js +34 -34
  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,899 @@
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.Version = exports.SendFeeEvent = exports.ManagerCap = exports.FeePool = exports.FeeInfo = void 0;
109
+ exports.isFeeInfo = isFeeInfo;
110
+ exports.isFeePool = isFeePool;
111
+ exports.isManagerCap = isManagerCap;
112
+ exports.isSendFeeEvent = isSendFeeEvent;
113
+ exports.isVersion = isVersion;
114
+ var reified = __importStar(require("../../../../_framework/reified"));
115
+ var reified_1 = require("../../../../_framework/reified");
116
+ var util_1 = require("../../../../_framework/util");
117
+ var structs_1 = require("../../0x1/type-name/structs");
118
+ var structs_2 = require("../../0x2/object/structs");
119
+ var structs_3 = require("../../0x2/vec-set/structs");
120
+ var index_1 = require("../index");
121
+ var bcs_1 = require("@mysten/sui/bcs");
122
+ var utils_1 = require("@mysten/sui/utils");
123
+ /* ============================== FeeInfo =============================== */
124
+ function isFeeInfo(type) {
125
+ type = (0, util_1.compressSuiType)(type);
126
+ return type === "".concat(index_1.PKG_V1, "::ecosystem::FeeInfo");
127
+ }
128
+ var FeeInfo = /** @class */ (function () {
129
+ function FeeInfo(typeArgs, fields) {
130
+ this.__StructClass = true;
131
+ this.$typeName = FeeInfo.$typeName;
132
+ this.$isPhantom = FeeInfo.$isPhantom;
133
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([FeeInfo.$typeName], __read(typeArgs), false));
134
+ this.$typeArgs = typeArgs;
135
+ this.token = fields.token;
136
+ this.value = fields.value;
137
+ }
138
+ FeeInfo.reified = function () {
139
+ var _this = this;
140
+ return {
141
+ typeName: FeeInfo.$typeName,
142
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([FeeInfo.$typeName], [], false)),
143
+ typeArgs: [],
144
+ isPhantom: FeeInfo.$isPhantom,
145
+ reifiedTypeArgs: [],
146
+ fromFields: function (fields) { return FeeInfo.fromFields(fields); },
147
+ fromFieldsWithTypes: function (item) { return FeeInfo.fromFieldsWithTypes(item); },
148
+ fromBcs: function (data) { return FeeInfo.fromBcs(data); },
149
+ bcs: FeeInfo.bcs,
150
+ fromJSONField: function (field) { return FeeInfo.fromJSONField(field); },
151
+ fromJSON: function (json) { return FeeInfo.fromJSON(json); },
152
+ fromSuiParsedData: function (content) { return FeeInfo.fromSuiParsedData(content); },
153
+ fromSuiObjectData: function (content) { return FeeInfo.fromSuiObjectData(content); },
154
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
155
+ return [2 /*return*/, FeeInfo.fetch(client, id)];
156
+ }); }); },
157
+ new: function (fields) {
158
+ return new FeeInfo([], fields);
159
+ },
160
+ kind: "StructClassReified",
161
+ };
162
+ };
163
+ Object.defineProperty(FeeInfo, "r", {
164
+ get: function () {
165
+ return FeeInfo.reified();
166
+ },
167
+ enumerable: false,
168
+ configurable: true
169
+ });
170
+ FeeInfo.phantom = function () {
171
+ return (0, reified_1.phantom)(FeeInfo.reified());
172
+ };
173
+ Object.defineProperty(FeeInfo, "p", {
174
+ get: function () {
175
+ return FeeInfo.phantom();
176
+ },
177
+ enumerable: false,
178
+ configurable: true
179
+ });
180
+ Object.defineProperty(FeeInfo, "bcs", {
181
+ get: function () {
182
+ return bcs_1.bcs.struct("FeeInfo", {
183
+ token: structs_1.TypeName.bcs,
184
+ value: bcs_1.bcs.u64(),
185
+ });
186
+ },
187
+ enumerable: false,
188
+ configurable: true
189
+ });
190
+ FeeInfo.fromFields = function (fields) {
191
+ return FeeInfo.reified().new({
192
+ token: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.token),
193
+ value: (0, reified_1.decodeFromFields)("u64", fields.value),
194
+ });
195
+ };
196
+ FeeInfo.fromFieldsWithTypes = function (item) {
197
+ if (!isFeeInfo(item.type)) {
198
+ throw new Error("not a FeeInfo type");
199
+ }
200
+ return FeeInfo.reified().new({
201
+ token: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.token),
202
+ value: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.value),
203
+ });
204
+ };
205
+ FeeInfo.fromBcs = function (data) {
206
+ return FeeInfo.fromFields(FeeInfo.bcs.parse(data));
207
+ };
208
+ FeeInfo.prototype.toJSONField = function () {
209
+ return {
210
+ token: this.token.toJSONField(),
211
+ value: this.value.toString(),
212
+ };
213
+ };
214
+ FeeInfo.prototype.toJSON = function () {
215
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
216
+ };
217
+ FeeInfo.fromJSONField = function (field) {
218
+ return FeeInfo.reified().new({
219
+ token: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.token),
220
+ value: (0, reified_1.decodeFromJSONField)("u64", field.value),
221
+ });
222
+ };
223
+ FeeInfo.fromJSON = function (json) {
224
+ if (json.$typeName !== FeeInfo.$typeName) {
225
+ throw new Error("not a WithTwoGenerics json object");
226
+ }
227
+ return FeeInfo.fromJSONField(json);
228
+ };
229
+ FeeInfo.fromSuiParsedData = function (content) {
230
+ if (content.dataType !== "moveObject") {
231
+ throw new Error("not an object");
232
+ }
233
+ if (!isFeeInfo(content.type)) {
234
+ throw new Error("object at ".concat(content.fields.id, " is not a FeeInfo object"));
235
+ }
236
+ return FeeInfo.fromFieldsWithTypes(content);
237
+ };
238
+ FeeInfo.fromSuiObjectData = function (data) {
239
+ if (data.bcs) {
240
+ if (data.bcs.dataType !== "moveObject" || !isFeeInfo(data.bcs.type)) {
241
+ throw new Error("object at is not a FeeInfo object");
242
+ }
243
+ return FeeInfo.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
244
+ }
245
+ if (data.content) {
246
+ return FeeInfo.fromSuiParsedData(data.content);
247
+ }
248
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
249
+ };
250
+ FeeInfo.fetch = function (client, id) {
251
+ return __awaiter(this, void 0, void 0, function () {
252
+ var res;
253
+ var _a, _b;
254
+ return __generator(this, function (_c) {
255
+ switch (_c.label) {
256
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
257
+ case 1:
258
+ res = _c.sent();
259
+ if (res.error) {
260
+ throw new Error("error fetching FeeInfo object at id ".concat(id, ": ").concat(res.error.code));
261
+ }
262
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isFeeInfo(res.data.bcs.type)) {
263
+ throw new Error("object at id ".concat(id, " is not a FeeInfo object"));
264
+ }
265
+ return [2 /*return*/, FeeInfo.fromSuiObjectData(res.data)];
266
+ }
267
+ });
268
+ });
269
+ };
270
+ FeeInfo.$typeName = "".concat(index_1.PKG_V1, "::ecosystem::FeeInfo");
271
+ FeeInfo.$numTypeParams = 0;
272
+ FeeInfo.$isPhantom = [];
273
+ return FeeInfo;
274
+ }());
275
+ exports.FeeInfo = FeeInfo;
276
+ /* ============================== FeePool =============================== */
277
+ function isFeePool(type) {
278
+ type = (0, util_1.compressSuiType)(type);
279
+ return type === "".concat(index_1.PKG_V1, "::ecosystem::FeePool");
280
+ }
281
+ var FeePool = /** @class */ (function () {
282
+ function FeePool(typeArgs, fields) {
283
+ this.__StructClass = true;
284
+ this.$typeName = FeePool.$typeName;
285
+ this.$isPhantom = FeePool.$isPhantom;
286
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([FeePool.$typeName], __read(typeArgs), false));
287
+ this.$typeArgs = typeArgs;
288
+ this.id = fields.id;
289
+ this.feeInfos = fields.feeInfos;
290
+ }
291
+ FeePool.reified = function () {
292
+ var _this = this;
293
+ return {
294
+ typeName: FeePool.$typeName,
295
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([FeePool.$typeName], [], false)),
296
+ typeArgs: [],
297
+ isPhantom: FeePool.$isPhantom,
298
+ reifiedTypeArgs: [],
299
+ fromFields: function (fields) { return FeePool.fromFields(fields); },
300
+ fromFieldsWithTypes: function (item) { return FeePool.fromFieldsWithTypes(item); },
301
+ fromBcs: function (data) { return FeePool.fromBcs(data); },
302
+ bcs: FeePool.bcs,
303
+ fromJSONField: function (field) { return FeePool.fromJSONField(field); },
304
+ fromJSON: function (json) { return FeePool.fromJSON(json); },
305
+ fromSuiParsedData: function (content) { return FeePool.fromSuiParsedData(content); },
306
+ fromSuiObjectData: function (content) { return FeePool.fromSuiObjectData(content); },
307
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
308
+ return [2 /*return*/, FeePool.fetch(client, id)];
309
+ }); }); },
310
+ new: function (fields) {
311
+ return new FeePool([], fields);
312
+ },
313
+ kind: "StructClassReified",
314
+ };
315
+ };
316
+ Object.defineProperty(FeePool, "r", {
317
+ get: function () {
318
+ return FeePool.reified();
319
+ },
320
+ enumerable: false,
321
+ configurable: true
322
+ });
323
+ FeePool.phantom = function () {
324
+ return (0, reified_1.phantom)(FeePool.reified());
325
+ };
326
+ Object.defineProperty(FeePool, "p", {
327
+ get: function () {
328
+ return FeePool.phantom();
329
+ },
330
+ enumerable: false,
331
+ configurable: true
332
+ });
333
+ Object.defineProperty(FeePool, "bcs", {
334
+ get: function () {
335
+ return bcs_1.bcs.struct("FeePool", {
336
+ id: structs_2.UID.bcs,
337
+ fee_infos: bcs_1.bcs.vector(FeeInfo.bcs),
338
+ });
339
+ },
340
+ enumerable: false,
341
+ configurable: true
342
+ });
343
+ FeePool.fromFields = function (fields) {
344
+ return FeePool.reified().new({
345
+ id: (0, reified_1.decodeFromFields)(structs_2.UID.reified(), fields.id),
346
+ feeInfos: (0, reified_1.decodeFromFields)(reified.vector(FeeInfo.reified()), fields.fee_infos),
347
+ });
348
+ };
349
+ FeePool.fromFieldsWithTypes = function (item) {
350
+ if (!isFeePool(item.type)) {
351
+ throw new Error("not a FeePool type");
352
+ }
353
+ return FeePool.reified().new({
354
+ id: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.UID.reified(), item.fields.id),
355
+ feeInfos: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(FeeInfo.reified()), item.fields.fee_infos),
356
+ });
357
+ };
358
+ FeePool.fromBcs = function (data) {
359
+ return FeePool.fromFields(FeePool.bcs.parse(data));
360
+ };
361
+ FeePool.prototype.toJSONField = function () {
362
+ return {
363
+ id: this.id,
364
+ feeInfos: (0, reified_1.fieldToJSON)("vector<".concat(FeeInfo.$typeName, ">"), this.feeInfos),
365
+ };
366
+ };
367
+ FeePool.prototype.toJSON = function () {
368
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
369
+ };
370
+ FeePool.fromJSONField = function (field) {
371
+ return FeePool.reified().new({
372
+ id: (0, reified_1.decodeFromJSONField)(structs_2.UID.reified(), field.id),
373
+ feeInfos: (0, reified_1.decodeFromJSONField)(reified.vector(FeeInfo.reified()), field.feeInfos),
374
+ });
375
+ };
376
+ FeePool.fromJSON = function (json) {
377
+ if (json.$typeName !== FeePool.$typeName) {
378
+ throw new Error("not a WithTwoGenerics json object");
379
+ }
380
+ return FeePool.fromJSONField(json);
381
+ };
382
+ FeePool.fromSuiParsedData = function (content) {
383
+ if (content.dataType !== "moveObject") {
384
+ throw new Error("not an object");
385
+ }
386
+ if (!isFeePool(content.type)) {
387
+ throw new Error("object at ".concat(content.fields.id, " is not a FeePool object"));
388
+ }
389
+ return FeePool.fromFieldsWithTypes(content);
390
+ };
391
+ FeePool.fromSuiObjectData = function (data) {
392
+ if (data.bcs) {
393
+ if (data.bcs.dataType !== "moveObject" || !isFeePool(data.bcs.type)) {
394
+ throw new Error("object at is not a FeePool object");
395
+ }
396
+ return FeePool.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
397
+ }
398
+ if (data.content) {
399
+ return FeePool.fromSuiParsedData(data.content);
400
+ }
401
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
402
+ };
403
+ FeePool.fetch = function (client, id) {
404
+ return __awaiter(this, void 0, void 0, function () {
405
+ var res;
406
+ var _a, _b;
407
+ return __generator(this, function (_c) {
408
+ switch (_c.label) {
409
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
410
+ case 1:
411
+ res = _c.sent();
412
+ if (res.error) {
413
+ throw new Error("error fetching FeePool object at id ".concat(id, ": ").concat(res.error.code));
414
+ }
415
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isFeePool(res.data.bcs.type)) {
416
+ throw new Error("object at id ".concat(id, " is not a FeePool object"));
417
+ }
418
+ return [2 /*return*/, FeePool.fromSuiObjectData(res.data)];
419
+ }
420
+ });
421
+ });
422
+ };
423
+ FeePool.$typeName = "".concat(index_1.PKG_V1, "::ecosystem::FeePool");
424
+ FeePool.$numTypeParams = 0;
425
+ FeePool.$isPhantom = [];
426
+ return FeePool;
427
+ }());
428
+ exports.FeePool = FeePool;
429
+ /* ============================== ManagerCap =============================== */
430
+ function isManagerCap(type) {
431
+ type = (0, util_1.compressSuiType)(type);
432
+ return type === "".concat(index_1.PKG_V1, "::ecosystem::ManagerCap");
433
+ }
434
+ var ManagerCap = /** @class */ (function () {
435
+ function ManagerCap(typeArgs, fields) {
436
+ this.__StructClass = true;
437
+ this.$typeName = ManagerCap.$typeName;
438
+ this.$isPhantom = ManagerCap.$isPhantom;
439
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([ManagerCap.$typeName], __read(typeArgs), false));
440
+ this.$typeArgs = typeArgs;
441
+ this.dummyField = fields.dummyField;
442
+ }
443
+ ManagerCap.reified = function () {
444
+ var _this = this;
445
+ return {
446
+ typeName: ManagerCap.$typeName,
447
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([ManagerCap.$typeName], [], false)),
448
+ typeArgs: [],
449
+ isPhantom: ManagerCap.$isPhantom,
450
+ reifiedTypeArgs: [],
451
+ fromFields: function (fields) { return ManagerCap.fromFields(fields); },
452
+ fromFieldsWithTypes: function (item) { return ManagerCap.fromFieldsWithTypes(item); },
453
+ fromBcs: function (data) { return ManagerCap.fromBcs(data); },
454
+ bcs: ManagerCap.bcs,
455
+ fromJSONField: function (field) { return ManagerCap.fromJSONField(field); },
456
+ fromJSON: function (json) { return ManagerCap.fromJSON(json); },
457
+ fromSuiParsedData: function (content) { return ManagerCap.fromSuiParsedData(content); },
458
+ fromSuiObjectData: function (content) { return ManagerCap.fromSuiObjectData(content); },
459
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
460
+ return [2 /*return*/, ManagerCap.fetch(client, id)];
461
+ }); }); },
462
+ new: function (fields) {
463
+ return new ManagerCap([], fields);
464
+ },
465
+ kind: "StructClassReified",
466
+ };
467
+ };
468
+ Object.defineProperty(ManagerCap, "r", {
469
+ get: function () {
470
+ return ManagerCap.reified();
471
+ },
472
+ enumerable: false,
473
+ configurable: true
474
+ });
475
+ ManagerCap.phantom = function () {
476
+ return (0, reified_1.phantom)(ManagerCap.reified());
477
+ };
478
+ Object.defineProperty(ManagerCap, "p", {
479
+ get: function () {
480
+ return ManagerCap.phantom();
481
+ },
482
+ enumerable: false,
483
+ configurable: true
484
+ });
485
+ Object.defineProperty(ManagerCap, "bcs", {
486
+ get: function () {
487
+ return bcs_1.bcs.struct("ManagerCap", {
488
+ dummy_field: bcs_1.bcs.bool(),
489
+ });
490
+ },
491
+ enumerable: false,
492
+ configurable: true
493
+ });
494
+ ManagerCap.fromFields = function (fields) {
495
+ return ManagerCap.reified().new({ dummyField: (0, reified_1.decodeFromFields)("bool", fields.dummy_field) });
496
+ };
497
+ ManagerCap.fromFieldsWithTypes = function (item) {
498
+ if (!isManagerCap(item.type)) {
499
+ throw new Error("not a ManagerCap type");
500
+ }
501
+ return ManagerCap.reified().new({ dummyField: (0, reified_1.decodeFromFieldsWithTypes)("bool", item.fields.dummy_field) });
502
+ };
503
+ ManagerCap.fromBcs = function (data) {
504
+ return ManagerCap.fromFields(ManagerCap.bcs.parse(data));
505
+ };
506
+ ManagerCap.prototype.toJSONField = function () {
507
+ return {
508
+ dummyField: this.dummyField,
509
+ };
510
+ };
511
+ ManagerCap.prototype.toJSON = function () {
512
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
513
+ };
514
+ ManagerCap.fromJSONField = function (field) {
515
+ return ManagerCap.reified().new({ dummyField: (0, reified_1.decodeFromJSONField)("bool", field.dummyField) });
516
+ };
517
+ ManagerCap.fromJSON = function (json) {
518
+ if (json.$typeName !== ManagerCap.$typeName) {
519
+ throw new Error("not a WithTwoGenerics json object");
520
+ }
521
+ return ManagerCap.fromJSONField(json);
522
+ };
523
+ ManagerCap.fromSuiParsedData = function (content) {
524
+ if (content.dataType !== "moveObject") {
525
+ throw new Error("not an object");
526
+ }
527
+ if (!isManagerCap(content.type)) {
528
+ throw new Error("object at ".concat(content.fields.id, " is not a ManagerCap object"));
529
+ }
530
+ return ManagerCap.fromFieldsWithTypes(content);
531
+ };
532
+ ManagerCap.fromSuiObjectData = function (data) {
533
+ if (data.bcs) {
534
+ if (data.bcs.dataType !== "moveObject" || !isManagerCap(data.bcs.type)) {
535
+ throw new Error("object at is not a ManagerCap object");
536
+ }
537
+ return ManagerCap.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
538
+ }
539
+ if (data.content) {
540
+ return ManagerCap.fromSuiParsedData(data.content);
541
+ }
542
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
543
+ };
544
+ ManagerCap.fetch = function (client, id) {
545
+ return __awaiter(this, void 0, void 0, function () {
546
+ var res;
547
+ var _a, _b;
548
+ return __generator(this, function (_c) {
549
+ switch (_c.label) {
550
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
551
+ case 1:
552
+ res = _c.sent();
553
+ if (res.error) {
554
+ throw new Error("error fetching ManagerCap object at id ".concat(id, ": ").concat(res.error.code));
555
+ }
556
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isManagerCap(res.data.bcs.type)) {
557
+ throw new Error("object at id ".concat(id, " is not a ManagerCap object"));
558
+ }
559
+ return [2 /*return*/, ManagerCap.fromSuiObjectData(res.data)];
560
+ }
561
+ });
562
+ });
563
+ };
564
+ ManagerCap.$typeName = "".concat(index_1.PKG_V1, "::ecosystem::ManagerCap");
565
+ ManagerCap.$numTypeParams = 0;
566
+ ManagerCap.$isPhantom = [];
567
+ return ManagerCap;
568
+ }());
569
+ exports.ManagerCap = ManagerCap;
570
+ /* ============================== SendFeeEvent =============================== */
571
+ function isSendFeeEvent(type) {
572
+ type = (0, util_1.compressSuiType)(type);
573
+ return type === "".concat(index_1.PKG_V1, "::ecosystem::SendFeeEvent");
574
+ }
575
+ var SendFeeEvent = /** @class */ (function () {
576
+ function SendFeeEvent(typeArgs, fields) {
577
+ this.__StructClass = true;
578
+ this.$typeName = SendFeeEvent.$typeName;
579
+ this.$isPhantom = SendFeeEvent.$isPhantom;
580
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([SendFeeEvent.$typeName], __read(typeArgs), false));
581
+ this.$typeArgs = typeArgs;
582
+ this.token = fields.token;
583
+ this.log = fields.log;
584
+ this.bcsPadding = fields.bcsPadding;
585
+ }
586
+ SendFeeEvent.reified = function () {
587
+ var _this = this;
588
+ return {
589
+ typeName: SendFeeEvent.$typeName,
590
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([SendFeeEvent.$typeName], [], false)),
591
+ typeArgs: [],
592
+ isPhantom: SendFeeEvent.$isPhantom,
593
+ reifiedTypeArgs: [],
594
+ fromFields: function (fields) { return SendFeeEvent.fromFields(fields); },
595
+ fromFieldsWithTypes: function (item) { return SendFeeEvent.fromFieldsWithTypes(item); },
596
+ fromBcs: function (data) { return SendFeeEvent.fromBcs(data); },
597
+ bcs: SendFeeEvent.bcs,
598
+ fromJSONField: function (field) { return SendFeeEvent.fromJSONField(field); },
599
+ fromJSON: function (json) { return SendFeeEvent.fromJSON(json); },
600
+ fromSuiParsedData: function (content) { return SendFeeEvent.fromSuiParsedData(content); },
601
+ fromSuiObjectData: function (content) { return SendFeeEvent.fromSuiObjectData(content); },
602
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
603
+ return [2 /*return*/, SendFeeEvent.fetch(client, id)];
604
+ }); }); },
605
+ new: function (fields) {
606
+ return new SendFeeEvent([], fields);
607
+ },
608
+ kind: "StructClassReified",
609
+ };
610
+ };
611
+ Object.defineProperty(SendFeeEvent, "r", {
612
+ get: function () {
613
+ return SendFeeEvent.reified();
614
+ },
615
+ enumerable: false,
616
+ configurable: true
617
+ });
618
+ SendFeeEvent.phantom = function () {
619
+ return (0, reified_1.phantom)(SendFeeEvent.reified());
620
+ };
621
+ Object.defineProperty(SendFeeEvent, "p", {
622
+ get: function () {
623
+ return SendFeeEvent.phantom();
624
+ },
625
+ enumerable: false,
626
+ configurable: true
627
+ });
628
+ Object.defineProperty(SendFeeEvent, "bcs", {
629
+ get: function () {
630
+ return bcs_1.bcs.struct("SendFeeEvent", {
631
+ token: structs_1.TypeName.bcs,
632
+ log: bcs_1.bcs.vector(bcs_1.bcs.u64()),
633
+ bcs_padding: bcs_1.bcs.vector(bcs_1.bcs.vector(bcs_1.bcs.u8())),
634
+ });
635
+ },
636
+ enumerable: false,
637
+ configurable: true
638
+ });
639
+ SendFeeEvent.fromFields = function (fields) {
640
+ return SendFeeEvent.reified().new({
641
+ token: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.token),
642
+ log: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.log),
643
+ bcsPadding: (0, reified_1.decodeFromFields)(reified.vector(reified.vector("u8")), fields.bcs_padding),
644
+ });
645
+ };
646
+ SendFeeEvent.fromFieldsWithTypes = function (item) {
647
+ if (!isSendFeeEvent(item.type)) {
648
+ throw new Error("not a SendFeeEvent type");
649
+ }
650
+ return SendFeeEvent.reified().new({
651
+ token: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.token),
652
+ log: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.log),
653
+ bcsPadding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(reified.vector("u8")), item.fields.bcs_padding),
654
+ });
655
+ };
656
+ SendFeeEvent.fromBcs = function (data) {
657
+ return SendFeeEvent.fromFields(SendFeeEvent.bcs.parse(data));
658
+ };
659
+ SendFeeEvent.prototype.toJSONField = function () {
660
+ return {
661
+ token: this.token.toJSONField(),
662
+ log: (0, reified_1.fieldToJSON)("vector<u64>", this.log),
663
+ bcsPadding: (0, reified_1.fieldToJSON)("vector<vector<u8>>", this.bcsPadding),
664
+ };
665
+ };
666
+ SendFeeEvent.prototype.toJSON = function () {
667
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
668
+ };
669
+ SendFeeEvent.fromJSONField = function (field) {
670
+ return SendFeeEvent.reified().new({
671
+ token: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.token),
672
+ log: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.log),
673
+ bcsPadding: (0, reified_1.decodeFromJSONField)(reified.vector(reified.vector("u8")), field.bcsPadding),
674
+ });
675
+ };
676
+ SendFeeEvent.fromJSON = function (json) {
677
+ if (json.$typeName !== SendFeeEvent.$typeName) {
678
+ throw new Error("not a WithTwoGenerics json object");
679
+ }
680
+ return SendFeeEvent.fromJSONField(json);
681
+ };
682
+ SendFeeEvent.fromSuiParsedData = function (content) {
683
+ if (content.dataType !== "moveObject") {
684
+ throw new Error("not an object");
685
+ }
686
+ if (!isSendFeeEvent(content.type)) {
687
+ throw new Error("object at ".concat(content.fields.id, " is not a SendFeeEvent object"));
688
+ }
689
+ return SendFeeEvent.fromFieldsWithTypes(content);
690
+ };
691
+ SendFeeEvent.fromSuiObjectData = function (data) {
692
+ if (data.bcs) {
693
+ if (data.bcs.dataType !== "moveObject" || !isSendFeeEvent(data.bcs.type)) {
694
+ throw new Error("object at is not a SendFeeEvent object");
695
+ }
696
+ return SendFeeEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
697
+ }
698
+ if (data.content) {
699
+ return SendFeeEvent.fromSuiParsedData(data.content);
700
+ }
701
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
702
+ };
703
+ SendFeeEvent.fetch = function (client, id) {
704
+ return __awaiter(this, void 0, void 0, function () {
705
+ var res;
706
+ var _a, _b;
707
+ return __generator(this, function (_c) {
708
+ switch (_c.label) {
709
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
710
+ case 1:
711
+ res = _c.sent();
712
+ if (res.error) {
713
+ throw new Error("error fetching SendFeeEvent object at id ".concat(id, ": ").concat(res.error.code));
714
+ }
715
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isSendFeeEvent(res.data.bcs.type)) {
716
+ throw new Error("object at id ".concat(id, " is not a SendFeeEvent object"));
717
+ }
718
+ return [2 /*return*/, SendFeeEvent.fromSuiObjectData(res.data)];
719
+ }
720
+ });
721
+ });
722
+ };
723
+ SendFeeEvent.$typeName = "".concat(index_1.PKG_V1, "::ecosystem::SendFeeEvent");
724
+ SendFeeEvent.$numTypeParams = 0;
725
+ SendFeeEvent.$isPhantom = [];
726
+ return SendFeeEvent;
727
+ }());
728
+ exports.SendFeeEvent = SendFeeEvent;
729
+ /* ============================== Version =============================== */
730
+ function isVersion(type) {
731
+ type = (0, util_1.compressSuiType)(type);
732
+ return type === "".concat(index_1.PKG_V1, "::ecosystem::Version");
733
+ }
734
+ var Version = /** @class */ (function () {
735
+ function Version(typeArgs, fields) {
736
+ this.__StructClass = true;
737
+ this.$typeName = Version.$typeName;
738
+ this.$isPhantom = Version.$isPhantom;
739
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([Version.$typeName], __read(typeArgs), false));
740
+ this.$typeArgs = typeArgs;
741
+ this.id = fields.id;
742
+ this.value = fields.value;
743
+ this.feePool = fields.feePool;
744
+ this.authority = fields.authority;
745
+ this.u64Padding = fields.u64Padding;
746
+ }
747
+ Version.reified = function () {
748
+ var _this = this;
749
+ return {
750
+ typeName: Version.$typeName,
751
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([Version.$typeName], [], false)),
752
+ typeArgs: [],
753
+ isPhantom: Version.$isPhantom,
754
+ reifiedTypeArgs: [],
755
+ fromFields: function (fields) { return Version.fromFields(fields); },
756
+ fromFieldsWithTypes: function (item) { return Version.fromFieldsWithTypes(item); },
757
+ fromBcs: function (data) { return Version.fromBcs(data); },
758
+ bcs: Version.bcs,
759
+ fromJSONField: function (field) { return Version.fromJSONField(field); },
760
+ fromJSON: function (json) { return Version.fromJSON(json); },
761
+ fromSuiParsedData: function (content) { return Version.fromSuiParsedData(content); },
762
+ fromSuiObjectData: function (content) { return Version.fromSuiObjectData(content); },
763
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
764
+ return [2 /*return*/, Version.fetch(client, id)];
765
+ }); }); },
766
+ new: function (fields) {
767
+ return new Version([], fields);
768
+ },
769
+ kind: "StructClassReified",
770
+ };
771
+ };
772
+ Object.defineProperty(Version, "r", {
773
+ get: function () {
774
+ return Version.reified();
775
+ },
776
+ enumerable: false,
777
+ configurable: true
778
+ });
779
+ Version.phantom = function () {
780
+ return (0, reified_1.phantom)(Version.reified());
781
+ };
782
+ Object.defineProperty(Version, "p", {
783
+ get: function () {
784
+ return Version.phantom();
785
+ },
786
+ enumerable: false,
787
+ configurable: true
788
+ });
789
+ Object.defineProperty(Version, "bcs", {
790
+ get: function () {
791
+ return bcs_1.bcs.struct("Version", {
792
+ id: structs_2.UID.bcs,
793
+ value: bcs_1.bcs.u64(),
794
+ fee_pool: FeePool.bcs,
795
+ authority: structs_3.VecSet.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); } })),
796
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
797
+ });
798
+ },
799
+ enumerable: false,
800
+ configurable: true
801
+ });
802
+ Version.fromFields = function (fields) {
803
+ return Version.reified().new({
804
+ id: (0, reified_1.decodeFromFields)(structs_2.UID.reified(), fields.id),
805
+ value: (0, reified_1.decodeFromFields)("u64", fields.value),
806
+ feePool: (0, reified_1.decodeFromFields)(FeePool.reified(), fields.fee_pool),
807
+ authority: (0, reified_1.decodeFromFields)(structs_3.VecSet.reified("address"), fields.authority),
808
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
809
+ });
810
+ };
811
+ Version.fromFieldsWithTypes = function (item) {
812
+ if (!isVersion(item.type)) {
813
+ throw new Error("not a Version type");
814
+ }
815
+ return Version.reified().new({
816
+ id: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.UID.reified(), item.fields.id),
817
+ value: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.value),
818
+ feePool: (0, reified_1.decodeFromFieldsWithTypes)(FeePool.reified(), item.fields.fee_pool),
819
+ authority: (0, reified_1.decodeFromFieldsWithTypes)(structs_3.VecSet.reified("address"), item.fields.authority),
820
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
821
+ });
822
+ };
823
+ Version.fromBcs = function (data) {
824
+ return Version.fromFields(Version.bcs.parse(data));
825
+ };
826
+ Version.prototype.toJSONField = function () {
827
+ return {
828
+ id: this.id,
829
+ value: this.value.toString(),
830
+ feePool: this.feePool.toJSONField(),
831
+ authority: this.authority.toJSONField(),
832
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
833
+ };
834
+ };
835
+ Version.prototype.toJSON = function () {
836
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
837
+ };
838
+ Version.fromJSONField = function (field) {
839
+ return Version.reified().new({
840
+ id: (0, reified_1.decodeFromJSONField)(structs_2.UID.reified(), field.id),
841
+ value: (0, reified_1.decodeFromJSONField)("u64", field.value),
842
+ feePool: (0, reified_1.decodeFromJSONField)(FeePool.reified(), field.feePool),
843
+ authority: (0, reified_1.decodeFromJSONField)(structs_3.VecSet.reified("address"), field.authority),
844
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
845
+ });
846
+ };
847
+ Version.fromJSON = function (json) {
848
+ if (json.$typeName !== Version.$typeName) {
849
+ throw new Error("not a WithTwoGenerics json object");
850
+ }
851
+ return Version.fromJSONField(json);
852
+ };
853
+ Version.fromSuiParsedData = function (content) {
854
+ if (content.dataType !== "moveObject") {
855
+ throw new Error("not an object");
856
+ }
857
+ if (!isVersion(content.type)) {
858
+ throw new Error("object at ".concat(content.fields.id, " is not a Version object"));
859
+ }
860
+ return Version.fromFieldsWithTypes(content);
861
+ };
862
+ Version.fromSuiObjectData = function (data) {
863
+ if (data.bcs) {
864
+ if (data.bcs.dataType !== "moveObject" || !isVersion(data.bcs.type)) {
865
+ throw new Error("object at is not a Version object");
866
+ }
867
+ return Version.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
868
+ }
869
+ if (data.content) {
870
+ return Version.fromSuiParsedData(data.content);
871
+ }
872
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
873
+ };
874
+ Version.fetch = function (client, id) {
875
+ return __awaiter(this, void 0, void 0, function () {
876
+ var res;
877
+ var _a, _b;
878
+ return __generator(this, function (_c) {
879
+ switch (_c.label) {
880
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
881
+ case 1:
882
+ res = _c.sent();
883
+ if (res.error) {
884
+ throw new Error("error fetching Version object at id ".concat(id, ": ").concat(res.error.code));
885
+ }
886
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isVersion(res.data.bcs.type)) {
887
+ throw new Error("object at id ".concat(id, " is not a Version object"));
888
+ }
889
+ return [2 /*return*/, Version.fromSuiObjectData(res.data)];
890
+ }
891
+ });
892
+ });
893
+ };
894
+ Version.$typeName = "".concat(index_1.PKG_V1, "::ecosystem::Version");
895
+ Version.$numTypeParams = 0;
896
+ Version.$isPhantom = [];
897
+ return Version;
898
+ }());
899
+ exports.Version = Version;