@suilend/springsui-cli 1.0.13 → 2.0.0

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 (60) hide show
  1. package/cli/src/bytecode.js +28 -30
  2. package/cli/src/index.js +51 -86
  3. package/package.json +1 -1
  4. package/sdk/src/_generated/_dependencies/source/0x1/ascii/structs.d.ts +7 -7
  5. package/sdk/src/_generated/_dependencies/source/0x1/ascii/structs.js +35 -75
  6. package/sdk/src/_generated/_dependencies/source/0x1/index.js +3 -6
  7. package/sdk/src/_generated/_dependencies/source/0x1/option/structs.d.ts +3 -3
  8. package/sdk/src/_generated/_dependencies/source/0x1/option/structs.js +31 -69
  9. package/sdk/src/_generated/_dependencies/source/0x1/string/structs.d.ts +4 -4
  10. package/sdk/src/_generated/_dependencies/source/0x1/string/structs.js +21 -59
  11. package/sdk/src/_generated/_dependencies/source/0x1/type-name/structs.d.ts +5 -5
  12. package/sdk/src/_generated/_dependencies/source/0x1/type-name/structs.js +20 -25
  13. package/sdk/src/_generated/_dependencies/source/0x2/bag/structs.d.ts +7 -7
  14. package/sdk/src/_generated/_dependencies/source/0x2/bag/structs.js +24 -29
  15. package/sdk/src/_generated/_dependencies/source/0x2/balance/structs.d.ts +7 -7
  16. package/sdk/src/_generated/_dependencies/source/0x2/balance/structs.js +49 -56
  17. package/sdk/src/_generated/_dependencies/source/0x2/coin/structs.d.ts +52 -52
  18. package/sdk/src/_generated/_dependencies/source/0x2/coin/structs.js +206 -223
  19. package/sdk/src/_generated/_dependencies/source/0x2/index.js +3 -6
  20. package/sdk/src/_generated/_dependencies/source/0x2/object/structs.d.ts +8 -8
  21. package/sdk/src/_generated/_dependencies/source/0x2/object/structs.js +34 -41
  22. package/sdk/src/_generated/_dependencies/source/0x2/sui/structs.d.ts +4 -4
  23. package/sdk/src/_generated/_dependencies/source/0x2/sui/structs.js +19 -24
  24. package/sdk/src/_generated/_dependencies/source/0x2/table/structs.d.ts +7 -7
  25. package/sdk/src/_generated/_dependencies/source/0x2/table/structs.js +31 -36
  26. package/sdk/src/_generated/_dependencies/source/0x2/url/structs.d.ts +5 -5
  27. package/sdk/src/_generated/_dependencies/source/0x2/url/structs.js +20 -25
  28. package/sdk/src/_generated/_dependencies/source/0x2/vec-map/structs.d.ts +5 -5
  29. package/sdk/src/_generated/_dependencies/source/0x2/vec-map/structs.js +57 -97
  30. package/sdk/src/_generated/_dependencies/source/0x3/index.js +3 -6
  31. package/sdk/src/_generated/_dependencies/source/0x3/staking-pool/structs.d.ts +60 -60
  32. package/sdk/src/_generated/_dependencies/source/0x3/staking-pool/structs.js +170 -218
  33. package/sdk/src/_generated/_framework/reified.d.ts +2 -2
  34. package/sdk/src/_generated/_framework/reified.js +27 -40
  35. package/sdk/src/_generated/_framework/util.d.ts +2 -14
  36. package/sdk/src/_generated/_framework/util.js +26 -40
  37. package/sdk/src/_generated/_framework/vector.d.ts +4 -4
  38. package/sdk/src/_generated/_framework/vector.js +16 -21
  39. package/sdk/src/_generated/liquid_staking/cell/structs.d.ts +4 -4
  40. package/sdk/src/_generated/liquid_staking/cell/structs.js +31 -36
  41. package/sdk/src/_generated/liquid_staking/fees/functions.js +55 -75
  42. package/sdk/src/_generated/liquid_staking/fees/structs.d.ts +21 -21
  43. package/sdk/src/_generated/liquid_staking/fees/structs.js +58 -65
  44. package/sdk/src/_generated/liquid_staking/index.js +6 -10
  45. package/sdk/src/_generated/liquid_staking/liquid-staking/functions.js +86 -107
  46. package/sdk/src/_generated/liquid_staking/liquid-staking/structs.d.ts +98 -98
  47. package/sdk/src/_generated/liquid_staking/liquid-staking/structs.js +264 -320
  48. package/sdk/src/_generated/liquid_staking/storage/structs.d.ts +31 -31
  49. package/sdk/src/_generated/liquid_staking/storage/structs.js +85 -125
  50. package/sdk/src/_generated/liquid_staking/version/structs.d.ts +4 -4
  51. package/sdk/src/_generated/liquid_staking/version/structs.js +19 -24
  52. package/sdk/src/_generated/liquid_staking/weight/functions.js +44 -56
  53. package/sdk/src/_generated/liquid_staking/weight/structs.d.ts +41 -41
  54. package/sdk/src/_generated/liquid_staking/weight/structs.js +128 -141
  55. package/sdk/src/client.d.ts +16 -16
  56. package/sdk/src/client.js +39 -82
  57. package/sdk/src/index.js +2 -18
  58. package/sdk/src/lib/index.js +1 -17
  59. package/sdk/src/lib/transactions.d.ts +1 -1
  60. package/sdk/src/lib/transactions.js +3 -8
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,33 +7,30 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Url = void 0;
13
- exports.isUrl = isUrl;
14
- const reified_1 = require("../../../../_framework/reified");
15
- const util_1 = require("../../../../_framework/util");
16
- const structs_1 = require("../../0x1/ascii/structs");
17
- const index_1 = require("../index");
18
- const bcs_1 = require("@mysten/sui/bcs");
19
- const utils_1 = require("@mysten/sui/utils");
10
+ import { decodeFromFields, decodeFromFieldsWithTypes, decodeFromJSONField, phantom, } from "../../../../_framework/reified";
11
+ import { composeSuiType, compressSuiType, } from "../../../../_framework/util";
12
+ import { String } from "../../0x1/ascii/structs";
13
+ import { PKG_V31 } from "../index";
14
+ import { bcs } from "@mysten/sui/bcs";
15
+ import { fromBase64 } from "@mysten/sui/utils";
20
16
  /* ============================== Url =============================== */
21
- function isUrl(type) {
22
- type = (0, util_1.compressSuiType)(type);
23
- return type === `${index_1.PKG_V31}::url::Url`;
17
+ export function isUrl(type) {
18
+ type = compressSuiType(type);
19
+ return type === `${PKG_V31}::url::Url`;
24
20
  }
25
- class Url {
21
+ export class Url {
26
22
  constructor(typeArgs, fields) {
27
23
  this.__StructClass = true;
28
24
  this.$typeName = Url.$typeName;
29
25
  this.$isPhantom = Url.$isPhantom;
30
- this.$fullTypeName = (0, util_1.composeSuiType)(Url.$typeName, ...typeArgs);
26
+ this.$fullTypeName = composeSuiType(Url.$typeName, ...typeArgs);
31
27
  this.$typeArgs = typeArgs;
32
28
  this.url = fields.url;
33
29
  }
34
30
  static reified() {
35
31
  return {
36
32
  typeName: Url.$typeName,
37
- fullTypeName: (0, util_1.composeSuiType)(Url.$typeName, ...[]),
33
+ fullTypeName: composeSuiType(Url.$typeName, ...[]),
38
34
  typeArgs: [],
39
35
  isPhantom: Url.$isPhantom,
40
36
  reifiedTypeArgs: [],
@@ -57,19 +53,19 @@ class Url {
57
53
  return Url.reified();
58
54
  }
59
55
  static phantom() {
60
- return (0, reified_1.phantom)(Url.reified());
56
+ return phantom(Url.reified());
61
57
  }
62
58
  static get p() {
63
59
  return Url.phantom();
64
60
  }
65
61
  static get bcs() {
66
- return bcs_1.bcs.struct("Url", {
67
- url: structs_1.String.bcs,
62
+ return bcs.struct("Url", {
63
+ url: String.bcs,
68
64
  });
69
65
  }
70
66
  static fromFields(fields) {
71
67
  return Url.reified().new({
72
- url: (0, reified_1.decodeFromFields)(structs_1.String.reified(), fields.url),
68
+ url: decodeFromFields(String.reified(), fields.url),
73
69
  });
74
70
  }
75
71
  static fromFieldsWithTypes(item) {
@@ -77,7 +73,7 @@ class Url {
77
73
  throw new Error("not a Url type");
78
74
  }
79
75
  return Url.reified().new({
80
- url: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.String.reified(), item.fields.url),
76
+ url: decodeFromFieldsWithTypes(String.reified(), item.fields.url),
81
77
  });
82
78
  }
83
79
  static fromBcs(data) {
@@ -93,7 +89,7 @@ class Url {
93
89
  }
94
90
  static fromJSONField(field) {
95
91
  return Url.reified().new({
96
- url: (0, reified_1.decodeFromJSONField)(structs_1.String.reified(), field.url),
92
+ url: decodeFromJSONField(String.reified(), field.url),
97
93
  });
98
94
  }
99
95
  static fromJSON(json) {
@@ -116,7 +112,7 @@ class Url {
116
112
  if (data.bcs.dataType !== "moveObject" || !isUrl(data.bcs.type)) {
117
113
  throw new Error(`object at is not a Url object`);
118
114
  }
119
- return Url.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
115
+ return Url.fromBcs(fromBase64(data.bcs.bcsBytes));
120
116
  }
121
117
  if (data.content) {
122
118
  return Url.fromSuiParsedData(data.content);
@@ -137,7 +133,6 @@ class Url {
137
133
  });
138
134
  }
139
135
  }
140
- exports.Url = Url;
141
- Url.$typeName = `${index_1.PKG_V31}::url::Url`;
136
+ Url.$typeName = `${PKG_V31}::url::Url`;
142
137
  Url.$numTypeParams = 0;
143
138
  Url.$isPhantom = [];
@@ -4,7 +4,7 @@ import { FieldsWithTypes } from "../../../../_framework/util";
4
4
  import { Vector } from "../../../../_framework/vector";
5
5
  import { PKG_V31 } from "../index";
6
6
  import { BcsType } from "@mysten/sui/bcs";
7
- import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
7
+ import { SuiJsonRpcClient, SuiObjectData, SuiParsedData } from "@mysten/sui/jsonRpc";
8
8
  export declare function isEntry(type: string): boolean;
9
9
  export interface EntryFields<K extends TypeArgument, V extends TypeArgument> {
10
10
  key: ToField<K>;
@@ -27,7 +27,7 @@ export declare class Entry<K extends TypeArgument, V extends TypeArgument> imple
27
27
  static get r(): typeof Entry.reified;
28
28
  static phantom<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(K: K, V: V): PhantomReified<ToTypeStr<Entry<ToTypeArgument<K>, ToTypeArgument<V>>>>;
29
29
  static get p(): typeof Entry.phantom;
30
- static get bcs(): <K extends BcsType<any>, V extends BcsType<any>>(K: K, V: V) => import("@mysten/sui/bcs").BcsStruct<{
30
+ static get bcs(): <K extends BcsType<any>, V extends BcsType<any>>(K: K, V: V) => import("@mysten/bcs").BcsStruct<{
31
31
  key: K;
32
32
  value: V;
33
33
  }, string>;
@@ -48,7 +48,7 @@ export declare class Entry<K extends TypeArgument, V extends TypeArgument> imple
48
48
  static fromJSON<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(typeArgs: [K, V], json: Record<string, any>): Entry<ToTypeArgument<K>, ToTypeArgument<V>>;
49
49
  static fromSuiParsedData<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(typeArgs: [K, V], content: SuiParsedData): Entry<ToTypeArgument<K>, ToTypeArgument<V>>;
50
50
  static fromSuiObjectData<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(typeArgs: [K, V], data: SuiObjectData): Entry<ToTypeArgument<K>, ToTypeArgument<V>>;
51
- static fetch<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(client: SuiClient, typeArgs: [K, V], id: string): Promise<Entry<ToTypeArgument<K>, ToTypeArgument<V>>>;
51
+ static fetch<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(client: SuiJsonRpcClient, typeArgs: [K, V], id: string): Promise<Entry<ToTypeArgument<K>, ToTypeArgument<V>>>;
52
52
  }
53
53
  export declare function isVecMap(type: string): boolean;
54
54
  export interface VecMapFields<K extends TypeArgument, V extends TypeArgument> {
@@ -70,7 +70,7 @@ export declare class VecMap<K extends TypeArgument, V extends TypeArgument> impl
70
70
  static get r(): typeof VecMap.reified;
71
71
  static phantom<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(K: K, V: V): PhantomReified<ToTypeStr<VecMap<ToTypeArgument<K>, ToTypeArgument<V>>>>;
72
72
  static get p(): typeof VecMap.phantom;
73
- static get bcs(): <K extends BcsType<any>, V extends BcsType<any>>(K: K, V: V) => import("@mysten/sui/bcs").BcsStruct<{
73
+ static get bcs(): <K extends BcsType<any>, V extends BcsType<any>>(K: K, V: V) => import("@mysten/bcs").BcsStruct<{
74
74
  contents: BcsType<{
75
75
  key: K extends BcsType<infer U, any, string> ? U : never;
76
76
  value: V extends BcsType<infer U, any, string> ? U : never;
@@ -102,5 +102,5 @@ export declare class VecMap<K extends TypeArgument, V extends TypeArgument> impl
102
102
  static fromJSON<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(typeArgs: [K, V], json: Record<string, any>): VecMap<ToTypeArgument<K>, ToTypeArgument<V>>;
103
103
  static fromSuiParsedData<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(typeArgs: [K, V], content: SuiParsedData): VecMap<ToTypeArgument<K>, ToTypeArgument<V>>;
104
104
  static fromSuiObjectData<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(typeArgs: [K, V], data: SuiObjectData): VecMap<ToTypeArgument<K>, ToTypeArgument<V>>;
105
- static fetch<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(client: SuiClient, typeArgs: [K, V], id: string): Promise<VecMap<ToTypeArgument<K>, ToTypeArgument<V>>>;
105
+ static fetch<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(client: SuiJsonRpcClient, typeArgs: [K, V], id: string): Promise<VecMap<ToTypeArgument<K>, ToTypeArgument<V>>>;
106
106
  }
@@ -1,37 +1,3 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -41,27 +7,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
41
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
42
8
  });
43
9
  };
44
- Object.defineProperty(exports, "__esModule", { value: true });
45
- exports.VecMap = exports.Entry = void 0;
46
- exports.isEntry = isEntry;
47
- exports.isVecMap = isVecMap;
48
- const reified = __importStar(require("../../../../_framework/reified"));
49
- const reified_1 = require("../../../../_framework/reified");
50
- const util_1 = require("../../../../_framework/util");
51
- const index_1 = require("../index");
52
- const bcs_1 = require("@mysten/sui/bcs");
53
- const utils_1 = require("@mysten/sui/utils");
10
+ import * as reified from "../../../../_framework/reified";
11
+ import { assertFieldsWithTypesArgsMatch, assertReifiedTypeArgsMatch, decodeFromFields, decodeFromFieldsWithTypes, decodeFromJSONField, extractType, fieldToJSON, phantom, toBcs, } from "../../../../_framework/reified";
12
+ import { composeSuiType, compressSuiType, parseTypeName, } from "../../../../_framework/util";
13
+ import { PKG_V31 } from "../index";
14
+ import { bcs } from "@mysten/sui/bcs";
15
+ import { fromBase64 } from "@mysten/sui/utils";
54
16
  /* ============================== Entry =============================== */
55
- function isEntry(type) {
56
- type = (0, util_1.compressSuiType)(type);
57
- return type.startsWith(`${index_1.PKG_V31}::vec_map::Entry` + "<");
17
+ export function isEntry(type) {
18
+ type = compressSuiType(type);
19
+ return type.startsWith(`${PKG_V31}::vec_map::Entry` + "<");
58
20
  }
59
- class Entry {
21
+ export class Entry {
60
22
  constructor(typeArgs, fields) {
61
23
  this.__StructClass = true;
62
24
  this.$typeName = Entry.$typeName;
63
25
  this.$isPhantom = Entry.$isPhantom;
64
- this.$fullTypeName = (0, util_1.composeSuiType)(Entry.$typeName, ...typeArgs);
26
+ this.$fullTypeName = composeSuiType(Entry.$typeName, ...typeArgs);
65
27
  this.$typeArgs = typeArgs;
66
28
  this.key = fields.key;
67
29
  this.value = fields.value;
@@ -69,21 +31,21 @@ class Entry {
69
31
  static reified(K, V) {
70
32
  return {
71
33
  typeName: Entry.$typeName,
72
- fullTypeName: (0, util_1.composeSuiType)(Entry.$typeName, ...[(0, reified_1.extractType)(K), (0, reified_1.extractType)(V)]),
73
- typeArgs: [(0, reified_1.extractType)(K), (0, reified_1.extractType)(V)],
34
+ fullTypeName: composeSuiType(Entry.$typeName, ...[extractType(K), extractType(V)]),
35
+ typeArgs: [extractType(K), extractType(V)],
74
36
  isPhantom: Entry.$isPhantom,
75
37
  reifiedTypeArgs: [K, V],
76
38
  fromFields: (fields) => Entry.fromFields([K, V], fields),
77
39
  fromFieldsWithTypes: (item) => Entry.fromFieldsWithTypes([K, V], item),
78
40
  fromBcs: (data) => Entry.fromBcs([K, V], data),
79
- bcs: Entry.bcs((0, reified_1.toBcs)(K), (0, reified_1.toBcs)(V)),
41
+ bcs: Entry.bcs(toBcs(K), toBcs(V)),
80
42
  fromJSONField: (field) => Entry.fromJSONField([K, V], field),
81
43
  fromJSON: (json) => Entry.fromJSON([K, V], json),
82
44
  fromSuiParsedData: (content) => Entry.fromSuiParsedData([K, V], content),
83
45
  fromSuiObjectData: (content) => Entry.fromSuiObjectData([K, V], content),
84
46
  fetch: (client, id) => __awaiter(this, void 0, void 0, function* () { return Entry.fetch(client, [K, V], id); }),
85
47
  new: (fields) => {
86
- return new Entry([(0, reified_1.extractType)(K), (0, reified_1.extractType)(V)], fields);
48
+ return new Entry([extractType(K), extractType(V)], fields);
87
49
  },
88
50
  kind: "StructClassReified",
89
51
  };
@@ -92,40 +54,40 @@ class Entry {
92
54
  return Entry.reified;
93
55
  }
94
56
  static phantom(K, V) {
95
- return (0, reified_1.phantom)(Entry.reified(K, V));
57
+ return phantom(Entry.reified(K, V));
96
58
  }
97
59
  static get p() {
98
60
  return Entry.phantom;
99
61
  }
100
62
  static get bcs() {
101
- return (K, V) => bcs_1.bcs.struct(`Entry<${K.name}, ${V.name}>`, {
63
+ return (K, V) => bcs.struct(`Entry<${K.name}, ${V.name}>`, {
102
64
  key: K,
103
65
  value: V,
104
66
  });
105
67
  }
106
68
  static fromFields(typeArgs, fields) {
107
69
  return Entry.reified(typeArgs[0], typeArgs[1]).new({
108
- key: (0, reified_1.decodeFromFields)(typeArgs[0], fields.key),
109
- value: (0, reified_1.decodeFromFields)(typeArgs[1], fields.value),
70
+ key: decodeFromFields(typeArgs[0], fields.key),
71
+ value: decodeFromFields(typeArgs[1], fields.value),
110
72
  });
111
73
  }
112
74
  static fromFieldsWithTypes(typeArgs, item) {
113
75
  if (!isEntry(item.type)) {
114
76
  throw new Error("not a Entry type");
115
77
  }
116
- (0, reified_1.assertFieldsWithTypesArgsMatch)(item, typeArgs);
78
+ assertFieldsWithTypesArgsMatch(item, typeArgs);
117
79
  return Entry.reified(typeArgs[0], typeArgs[1]).new({
118
- key: (0, reified_1.decodeFromFieldsWithTypes)(typeArgs[0], item.fields.key),
119
- value: (0, reified_1.decodeFromFieldsWithTypes)(typeArgs[1], item.fields.value),
80
+ key: decodeFromFieldsWithTypes(typeArgs[0], item.fields.key),
81
+ value: decodeFromFieldsWithTypes(typeArgs[1], item.fields.value),
120
82
  });
121
83
  }
122
84
  static fromBcs(typeArgs, data) {
123
- return Entry.fromFields(typeArgs, Entry.bcs((0, reified_1.toBcs)(typeArgs[0]), (0, reified_1.toBcs)(typeArgs[1])).parse(data));
85
+ return Entry.fromFields(typeArgs, Entry.bcs(toBcs(typeArgs[0]), toBcs(typeArgs[1])).parse(data));
124
86
  }
125
87
  toJSONField() {
126
88
  return {
127
- key: (0, reified_1.fieldToJSON)(this.$typeArgs[0], this.key),
128
- value: (0, reified_1.fieldToJSON)(this.$typeArgs[1], this.value),
89
+ key: fieldToJSON(this.$typeArgs[0], this.key),
90
+ value: fieldToJSON(this.$typeArgs[1], this.value),
129
91
  };
130
92
  }
131
93
  toJSON() {
@@ -133,15 +95,15 @@ class Entry {
133
95
  }
134
96
  static fromJSONField(typeArgs, field) {
135
97
  return Entry.reified(typeArgs[0], typeArgs[1]).new({
136
- key: (0, reified_1.decodeFromJSONField)(typeArgs[0], field.key),
137
- value: (0, reified_1.decodeFromJSONField)(typeArgs[1], field.value),
98
+ key: decodeFromJSONField(typeArgs[0], field.key),
99
+ value: decodeFromJSONField(typeArgs[1], field.value),
138
100
  });
139
101
  }
140
102
  static fromJSON(typeArgs, json) {
141
103
  if (json.$typeName !== Entry.$typeName) {
142
104
  throw new Error("not a WithTwoGenerics json object");
143
105
  }
144
- (0, reified_1.assertReifiedTypeArgsMatch)((0, util_1.composeSuiType)(Entry.$typeName, ...typeArgs.map(reified_1.extractType)), json.$typeArgs, typeArgs);
106
+ assertReifiedTypeArgsMatch(composeSuiType(Entry.$typeName, ...typeArgs.map(extractType)), json.$typeArgs, typeArgs);
145
107
  return Entry.fromJSONField(typeArgs, json);
146
108
  }
147
109
  static fromSuiParsedData(typeArgs, content) {
@@ -158,18 +120,18 @@ class Entry {
158
120
  if (data.bcs.dataType !== "moveObject" || !isEntry(data.bcs.type)) {
159
121
  throw new Error(`object at is not a Entry object`);
160
122
  }
161
- const gotTypeArgs = (0, util_1.parseTypeName)(data.bcs.type).typeArgs;
123
+ const gotTypeArgs = parseTypeName(data.bcs.type).typeArgs;
162
124
  if (gotTypeArgs.length !== 2) {
163
125
  throw new Error(`type argument mismatch: expected 2 type arguments but got ${gotTypeArgs.length}`);
164
126
  }
165
127
  for (let i = 0; i < 2; i++) {
166
- const gotTypeArg = (0, util_1.compressSuiType)(gotTypeArgs[i]);
167
- const expectedTypeArg = (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArgs[i]));
128
+ const gotTypeArg = compressSuiType(gotTypeArgs[i]);
129
+ const expectedTypeArg = compressSuiType(extractType(typeArgs[i]));
168
130
  if (gotTypeArg !== expectedTypeArg) {
169
131
  throw new Error(`type argument mismatch at position ${i}: expected '${expectedTypeArg}' but got '${gotTypeArg}'`);
170
132
  }
171
133
  }
172
- return Entry.fromBcs(typeArgs, (0, utils_1.fromB64)(data.bcs.bcsBytes));
134
+ return Entry.fromBcs(typeArgs, fromBase64(data.bcs.bcsBytes));
173
135
  }
174
136
  if (data.content) {
175
137
  return Entry.fromSuiParsedData(typeArgs, data.content);
@@ -191,42 +153,41 @@ class Entry {
191
153
  });
192
154
  }
193
155
  }
194
- exports.Entry = Entry;
195
- Entry.$typeName = `${index_1.PKG_V31}::vec_map::Entry`;
156
+ Entry.$typeName = `${PKG_V31}::vec_map::Entry`;
196
157
  Entry.$numTypeParams = 2;
197
158
  Entry.$isPhantom = [false, false];
198
159
  /* ============================== VecMap =============================== */
199
- function isVecMap(type) {
200
- type = (0, util_1.compressSuiType)(type);
201
- return type.startsWith(`${index_1.PKG_V31}::vec_map::VecMap` + "<");
160
+ export function isVecMap(type) {
161
+ type = compressSuiType(type);
162
+ return type.startsWith(`${PKG_V31}::vec_map::VecMap` + "<");
202
163
  }
203
- class VecMap {
164
+ export class VecMap {
204
165
  constructor(typeArgs, fields) {
205
166
  this.__StructClass = true;
206
167
  this.$typeName = VecMap.$typeName;
207
168
  this.$isPhantom = VecMap.$isPhantom;
208
- this.$fullTypeName = (0, util_1.composeSuiType)(VecMap.$typeName, ...typeArgs);
169
+ this.$fullTypeName = composeSuiType(VecMap.$typeName, ...typeArgs);
209
170
  this.$typeArgs = typeArgs;
210
171
  this.contents = fields.contents;
211
172
  }
212
173
  static reified(K, V) {
213
174
  return {
214
175
  typeName: VecMap.$typeName,
215
- fullTypeName: (0, util_1.composeSuiType)(VecMap.$typeName, ...[(0, reified_1.extractType)(K), (0, reified_1.extractType)(V)]),
216
- typeArgs: [(0, reified_1.extractType)(K), (0, reified_1.extractType)(V)],
176
+ fullTypeName: composeSuiType(VecMap.$typeName, ...[extractType(K), extractType(V)]),
177
+ typeArgs: [extractType(K), extractType(V)],
217
178
  isPhantom: VecMap.$isPhantom,
218
179
  reifiedTypeArgs: [K, V],
219
180
  fromFields: (fields) => VecMap.fromFields([K, V], fields),
220
181
  fromFieldsWithTypes: (item) => VecMap.fromFieldsWithTypes([K, V], item),
221
182
  fromBcs: (data) => VecMap.fromBcs([K, V], data),
222
- bcs: VecMap.bcs((0, reified_1.toBcs)(K), (0, reified_1.toBcs)(V)),
183
+ bcs: VecMap.bcs(toBcs(K), toBcs(V)),
223
184
  fromJSONField: (field) => VecMap.fromJSONField([K, V], field),
224
185
  fromJSON: (json) => VecMap.fromJSON([K, V], json),
225
186
  fromSuiParsedData: (content) => VecMap.fromSuiParsedData([K, V], content),
226
187
  fromSuiObjectData: (content) => VecMap.fromSuiObjectData([K, V], content),
227
188
  fetch: (client, id) => __awaiter(this, void 0, void 0, function* () { return VecMap.fetch(client, [K, V], id); }),
228
189
  new: (fields) => {
229
- return new VecMap([(0, reified_1.extractType)(K), (0, reified_1.extractType)(V)], fields);
190
+ return new VecMap([extractType(K), extractType(V)], fields);
230
191
  },
231
192
  kind: "StructClassReified",
232
193
  };
@@ -235,36 +196,36 @@ class VecMap {
235
196
  return VecMap.reified;
236
197
  }
237
198
  static phantom(K, V) {
238
- return (0, reified_1.phantom)(VecMap.reified(K, V));
199
+ return phantom(VecMap.reified(K, V));
239
200
  }
240
201
  static get p() {
241
202
  return VecMap.phantom;
242
203
  }
243
204
  static get bcs() {
244
- return (K, V) => bcs_1.bcs.struct(`VecMap<${K.name}, ${V.name}>`, {
245
- contents: bcs_1.bcs.vector(Entry.bcs(K, V)),
205
+ return (K, V) => bcs.struct(`VecMap<${K.name}, ${V.name}>`, {
206
+ contents: bcs.vector(Entry.bcs(K, V)),
246
207
  });
247
208
  }
248
209
  static fromFields(typeArgs, fields) {
249
210
  return VecMap.reified(typeArgs[0], typeArgs[1]).new({
250
- contents: (0, reified_1.decodeFromFields)(reified.vector(Entry.reified(typeArgs[0], typeArgs[1])), fields.contents),
211
+ contents: decodeFromFields(reified.vector(Entry.reified(typeArgs[0], typeArgs[1])), fields.contents),
251
212
  });
252
213
  }
253
214
  static fromFieldsWithTypes(typeArgs, item) {
254
215
  if (!isVecMap(item.type)) {
255
216
  throw new Error("not a VecMap type");
256
217
  }
257
- (0, reified_1.assertFieldsWithTypesArgsMatch)(item, typeArgs);
218
+ assertFieldsWithTypesArgsMatch(item, typeArgs);
258
219
  return VecMap.reified(typeArgs[0], typeArgs[1]).new({
259
- contents: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(Entry.reified(typeArgs[0], typeArgs[1])), item.fields.contents),
220
+ contents: decodeFromFieldsWithTypes(reified.vector(Entry.reified(typeArgs[0], typeArgs[1])), item.fields.contents),
260
221
  });
261
222
  }
262
223
  static fromBcs(typeArgs, data) {
263
- return VecMap.fromFields(typeArgs, VecMap.bcs((0, reified_1.toBcs)(typeArgs[0]), (0, reified_1.toBcs)(typeArgs[1])).parse(data));
224
+ return VecMap.fromFields(typeArgs, VecMap.bcs(toBcs(typeArgs[0]), toBcs(typeArgs[1])).parse(data));
264
225
  }
265
226
  toJSONField() {
266
227
  return {
267
- contents: (0, reified_1.fieldToJSON)(`vector<${Entry.$typeName}<${this.$typeArgs[0]}, ${this.$typeArgs[1]}>>`, this.contents),
228
+ contents: fieldToJSON(`vector<${Entry.$typeName}<${this.$typeArgs[0]}, ${this.$typeArgs[1]}>>`, this.contents),
268
229
  };
269
230
  }
270
231
  toJSON() {
@@ -272,14 +233,14 @@ class VecMap {
272
233
  }
273
234
  static fromJSONField(typeArgs, field) {
274
235
  return VecMap.reified(typeArgs[0], typeArgs[1]).new({
275
- contents: (0, reified_1.decodeFromJSONField)(reified.vector(Entry.reified(typeArgs[0], typeArgs[1])), field.contents),
236
+ contents: decodeFromJSONField(reified.vector(Entry.reified(typeArgs[0], typeArgs[1])), field.contents),
276
237
  });
277
238
  }
278
239
  static fromJSON(typeArgs, json) {
279
240
  if (json.$typeName !== VecMap.$typeName) {
280
241
  throw new Error("not a WithTwoGenerics json object");
281
242
  }
282
- (0, reified_1.assertReifiedTypeArgsMatch)((0, util_1.composeSuiType)(VecMap.$typeName, ...typeArgs.map(reified_1.extractType)), json.$typeArgs, typeArgs);
243
+ assertReifiedTypeArgsMatch(composeSuiType(VecMap.$typeName, ...typeArgs.map(extractType)), json.$typeArgs, typeArgs);
283
244
  return VecMap.fromJSONField(typeArgs, json);
284
245
  }
285
246
  static fromSuiParsedData(typeArgs, content) {
@@ -296,18 +257,18 @@ class VecMap {
296
257
  if (data.bcs.dataType !== "moveObject" || !isVecMap(data.bcs.type)) {
297
258
  throw new Error(`object at is not a VecMap object`);
298
259
  }
299
- const gotTypeArgs = (0, util_1.parseTypeName)(data.bcs.type).typeArgs;
260
+ const gotTypeArgs = parseTypeName(data.bcs.type).typeArgs;
300
261
  if (gotTypeArgs.length !== 2) {
301
262
  throw new Error(`type argument mismatch: expected 2 type arguments but got ${gotTypeArgs.length}`);
302
263
  }
303
264
  for (let i = 0; i < 2; i++) {
304
- const gotTypeArg = (0, util_1.compressSuiType)(gotTypeArgs[i]);
305
- const expectedTypeArg = (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArgs[i]));
265
+ const gotTypeArg = compressSuiType(gotTypeArgs[i]);
266
+ const expectedTypeArg = compressSuiType(extractType(typeArgs[i]));
306
267
  if (gotTypeArg !== expectedTypeArg) {
307
268
  throw new Error(`type argument mismatch at position ${i}: expected '${expectedTypeArg}' but got '${gotTypeArg}'`);
308
269
  }
309
270
  }
310
- return VecMap.fromBcs(typeArgs, (0, utils_1.fromB64)(data.bcs.bcsBytes));
271
+ return VecMap.fromBcs(typeArgs, fromBase64(data.bcs.bcsBytes));
311
272
  }
312
273
  if (data.content) {
313
274
  return VecMap.fromSuiParsedData(typeArgs, data.content);
@@ -329,7 +290,6 @@ class VecMap {
329
290
  });
330
291
  }
331
292
  }
332
- exports.VecMap = VecMap;
333
- VecMap.$typeName = `${index_1.PKG_V31}::vec_map::VecMap`;
293
+ VecMap.$typeName = `${PKG_V31}::vec_map::VecMap`;
334
294
  VecMap.$numTypeParams = 2;
335
295
  VecMap.$isPhantom = [false, false];
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PKG_V19 = exports.PUBLISHED_AT = exports.PACKAGE_ID = void 0;
4
- exports.PACKAGE_ID = "0x3";
5
- exports.PUBLISHED_AT = "0x3";
6
- exports.PKG_V19 = "0x3";
1
+ export const PACKAGE_ID = "0x3";
2
+ export const PUBLISHED_AT = "0x3";
3
+ export const PKG_V19 = "0x3";