@typus/typus-perp-sdk 1.0.51 → 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 (111) 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/package.json +1 -1
  105. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/index.d.ts +0 -8
  106. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/index.js +0 -11
  107. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/index.d.ts +0 -3
  108. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/index.js +0 -6
  109. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/index.d.ts +0 -3
  110. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/index.js +0 -6
  111. /package/dist/src/_dependencies/source/{0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded → 0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274}/vault/structs.js +0 -0
@@ -0,0 +1,53 @@
1
+ import { PhantomReified, Reified, StructClass, ToField, ToTypeStr } from "../../../../_framework/reified";
2
+ import { FieldsWithTypes } from "../../../../_framework/util";
3
+ import { String } from "../../0x1/ascii/structs";
4
+ import { PKG_V26 } from "../index";
5
+ import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
6
+ export declare function isUrl(type: string): boolean;
7
+ export interface UrlFields {
8
+ url: ToField<String>;
9
+ }
10
+ export type UrlReified = Reified<Url, UrlFields>;
11
+ export declare class Url implements StructClass {
12
+ __StructClass: true;
13
+ static readonly $typeName = "0x2::url::Url";
14
+ static readonly $numTypeParams = 0;
15
+ static readonly $isPhantom: readonly [];
16
+ readonly $typeName = "0x2::url::Url";
17
+ readonly $fullTypeName: `${typeof PKG_V26}::url::Url`;
18
+ readonly $typeArgs: [];
19
+ readonly $isPhantom: readonly [];
20
+ readonly url: ToField<String>;
21
+ private constructor();
22
+ static reified(): UrlReified;
23
+ static get r(): import("../../../../_framework/reified").StructClassReified<Url, UrlFields>;
24
+ static phantom(): PhantomReified<ToTypeStr<Url>>;
25
+ static get p(): PhantomReified<"0x2::url::Url">;
26
+ static get bcs(): import("@mysten/sui/bcs").BcsType<{
27
+ url: {
28
+ bytes: number[];
29
+ };
30
+ }, {
31
+ url: {
32
+ bytes: Iterable<number> & {
33
+ length: number;
34
+ };
35
+ };
36
+ }>;
37
+ static fromFields(fields: Record<string, any>): Url;
38
+ static fromFieldsWithTypes(item: FieldsWithTypes): Url;
39
+ static fromBcs(data: Uint8Array): Url;
40
+ toJSONField(): {
41
+ url: string;
42
+ };
43
+ toJSON(): {
44
+ url: string;
45
+ $typeName: string;
46
+ $typeArgs: [];
47
+ };
48
+ static fromJSONField(field: any): Url;
49
+ static fromJSON(json: Record<string, any>): Url;
50
+ static fromSuiParsedData(content: SuiParsedData): Url;
51
+ static fromSuiObjectData(data: SuiObjectData): Url;
52
+ static fetch(client: SuiClient, id: string): Promise<Url>;
53
+ }
@@ -0,0 +1,223 @@
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
+ return new (P || (P = Promise))(function (resolve, reject) {
16
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
20
+ });
21
+ };
22
+ var __generator = (this && this.__generator) || function (thisArg, body) {
23
+ 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);
24
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
+ function verb(n) { return function (v) { return step([n, v]); }; }
26
+ function step(op) {
27
+ if (f) throw new TypeError("Generator is already executing.");
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
+ 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;
30
+ if (y = 0, t) op = [op[0] & 2, t.value];
31
+ switch (op[0]) {
32
+ case 0: case 1: t = op; break;
33
+ case 4: _.label++; return { value: op[1], done: false };
34
+ case 5: _.label++; y = op[1]; op = [0]; continue;
35
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
+ default:
37
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
+ if (t[2]) _.ops.pop();
42
+ _.trys.pop(); continue;
43
+ }
44
+ op = body.call(thisArg, _);
45
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
+ }
48
+ };
49
+ var __read = (this && this.__read) || function (o, n) {
50
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
51
+ if (!m) return o;
52
+ var i = m.call(o), r, ar = [], e;
53
+ try {
54
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
55
+ }
56
+ catch (error) { e = { error: error }; }
57
+ finally {
58
+ try {
59
+ if (r && !r.done && (m = i["return"])) m.call(i);
60
+ }
61
+ finally { if (e) throw e.error; }
62
+ }
63
+ return ar;
64
+ };
65
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
66
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
67
+ if (ar || !(i in from)) {
68
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
69
+ ar[i] = from[i];
70
+ }
71
+ }
72
+ return to.concat(ar || Array.prototype.slice.call(from));
73
+ };
74
+ Object.defineProperty(exports, "__esModule", { value: true });
75
+ exports.Url = void 0;
76
+ exports.isUrl = isUrl;
77
+ var reified_1 = require("../../../../_framework/reified");
78
+ var util_1 = require("../../../../_framework/util");
79
+ var structs_1 = require("../../0x1/ascii/structs");
80
+ var index_1 = require("../index");
81
+ var bcs_1 = require("@mysten/sui/bcs");
82
+ var utils_1 = require("@mysten/sui/utils");
83
+ /* ============================== Url =============================== */
84
+ function isUrl(type) {
85
+ type = (0, util_1.compressSuiType)(type);
86
+ return type === "".concat(index_1.PKG_V26, "::url::Url");
87
+ }
88
+ var Url = /** @class */ (function () {
89
+ function Url(typeArgs, fields) {
90
+ this.__StructClass = true;
91
+ this.$typeName = Url.$typeName;
92
+ this.$isPhantom = Url.$isPhantom;
93
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([Url.$typeName], __read(typeArgs), false));
94
+ this.$typeArgs = typeArgs;
95
+ this.url = fields.url;
96
+ }
97
+ Url.reified = function () {
98
+ var _this = this;
99
+ return {
100
+ typeName: Url.$typeName,
101
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([Url.$typeName], [], false)),
102
+ typeArgs: [],
103
+ isPhantom: Url.$isPhantom,
104
+ reifiedTypeArgs: [],
105
+ fromFields: function (fields) { return Url.fromFields(fields); },
106
+ fromFieldsWithTypes: function (item) { return Url.fromFieldsWithTypes(item); },
107
+ fromBcs: function (data) { return Url.fromBcs(data); },
108
+ bcs: Url.bcs,
109
+ fromJSONField: function (field) { return Url.fromJSONField(field); },
110
+ fromJSON: function (json) { return Url.fromJSON(json); },
111
+ fromSuiParsedData: function (content) { return Url.fromSuiParsedData(content); },
112
+ fromSuiObjectData: function (content) { return Url.fromSuiObjectData(content); },
113
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
114
+ return [2 /*return*/, Url.fetch(client, id)];
115
+ }); }); },
116
+ new: function (fields) {
117
+ return new Url([], fields);
118
+ },
119
+ kind: "StructClassReified",
120
+ };
121
+ };
122
+ Object.defineProperty(Url, "r", {
123
+ get: function () {
124
+ return Url.reified();
125
+ },
126
+ enumerable: false,
127
+ configurable: true
128
+ });
129
+ Url.phantom = function () {
130
+ return (0, reified_1.phantom)(Url.reified());
131
+ };
132
+ Object.defineProperty(Url, "p", {
133
+ get: function () {
134
+ return Url.phantom();
135
+ },
136
+ enumerable: false,
137
+ configurable: true
138
+ });
139
+ Object.defineProperty(Url, "bcs", {
140
+ get: function () {
141
+ return bcs_1.bcs.struct("Url", {
142
+ url: structs_1.String.bcs,
143
+ });
144
+ },
145
+ enumerable: false,
146
+ configurable: true
147
+ });
148
+ Url.fromFields = function (fields) {
149
+ return Url.reified().new({ url: (0, reified_1.decodeFromFields)(structs_1.String.reified(), fields.url) });
150
+ };
151
+ Url.fromFieldsWithTypes = function (item) {
152
+ if (!isUrl(item.type)) {
153
+ throw new Error("not a Url type");
154
+ }
155
+ return Url.reified().new({ url: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.String.reified(), item.fields.url) });
156
+ };
157
+ Url.fromBcs = function (data) {
158
+ return Url.fromFields(Url.bcs.parse(data));
159
+ };
160
+ Url.prototype.toJSONField = function () {
161
+ return {
162
+ url: this.url,
163
+ };
164
+ };
165
+ Url.prototype.toJSON = function () {
166
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
167
+ };
168
+ Url.fromJSONField = function (field) {
169
+ return Url.reified().new({ url: (0, reified_1.decodeFromJSONField)(structs_1.String.reified(), field.url) });
170
+ };
171
+ Url.fromJSON = function (json) {
172
+ if (json.$typeName !== Url.$typeName) {
173
+ throw new Error("not a WithTwoGenerics json object");
174
+ }
175
+ return Url.fromJSONField(json);
176
+ };
177
+ Url.fromSuiParsedData = function (content) {
178
+ if (content.dataType !== "moveObject") {
179
+ throw new Error("not an object");
180
+ }
181
+ if (!isUrl(content.type)) {
182
+ throw new Error("object at ".concat(content.fields.id, " is not a Url object"));
183
+ }
184
+ return Url.fromFieldsWithTypes(content);
185
+ };
186
+ Url.fromSuiObjectData = function (data) {
187
+ if (data.bcs) {
188
+ if (data.bcs.dataType !== "moveObject" || !isUrl(data.bcs.type)) {
189
+ throw new Error("object at is not a Url object");
190
+ }
191
+ return Url.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
192
+ }
193
+ if (data.content) {
194
+ return Url.fromSuiParsedData(data.content);
195
+ }
196
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
197
+ };
198
+ Url.fetch = function (client, id) {
199
+ return __awaiter(this, void 0, void 0, function () {
200
+ var res;
201
+ var _a, _b;
202
+ return __generator(this, function (_c) {
203
+ switch (_c.label) {
204
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
205
+ case 1:
206
+ res = _c.sent();
207
+ if (res.error) {
208
+ throw new Error("error fetching Url object at id ".concat(id, ": ").concat(res.error.code));
209
+ }
210
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isUrl(res.data.bcs.type)) {
211
+ throw new Error("object at id ".concat(id, " is not a Url object"));
212
+ }
213
+ return [2 /*return*/, Url.fromSuiObjectData(res.data)];
214
+ }
215
+ });
216
+ });
217
+ };
218
+ Url.$typeName = "".concat(index_1.PKG_V26, "::url::Url");
219
+ Url.$numTypeParams = 0;
220
+ Url.$isPhantom = [];
221
+ return Url;
222
+ }());
223
+ exports.Url = Url;