@suilend/springsui-cli 1.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 (63) hide show
  1. package/cli/src/index.d.ts +1 -0
  2. package/cli/src/index.js +304 -0
  3. package/package.json +1 -0
  4. package/sdk/src/_generated/_dependencies/source/0x1/ascii/structs.d.ts +92 -0
  5. package/sdk/src/_generated/_dependencies/source/0x1/ascii/structs.js +289 -0
  6. package/sdk/src/_generated/_dependencies/source/0x1/index.d.ts +3 -0
  7. package/sdk/src/_generated/_dependencies/source/0x1/index.js +6 -0
  8. package/sdk/src/_generated/_dependencies/source/0x1/option/structs.d.ts +52 -0
  9. package/sdk/src/_generated/_dependencies/source/0x1/option/structs.js +180 -0
  10. package/sdk/src/_generated/_dependencies/source/0x1/string/structs.d.ts +50 -0
  11. package/sdk/src/_generated/_dependencies/source/0x1/string/structs.js +167 -0
  12. package/sdk/src/_generated/_dependencies/source/0x1/type-name/structs.d.ts +53 -0
  13. package/sdk/src/_generated/_dependencies/source/0x1/type-name/structs.js +144 -0
  14. package/sdk/src/_generated/_dependencies/source/0x2/bag/structs.d.ts +61 -0
  15. package/sdk/src/_generated/_dependencies/source/0x2/bag/structs.js +149 -0
  16. package/sdk/src/_generated/_dependencies/source/0x2/balance/structs.d.ts +88 -0
  17. package/sdk/src/_generated/_dependencies/source/0x2/balance/structs.js +291 -0
  18. package/sdk/src/_generated/_dependencies/source/0x2/coin/structs.d.ts +460 -0
  19. package/sdk/src/_generated/_dependencies/source/0x2/coin/structs.js +1045 -0
  20. package/sdk/src/_generated/_dependencies/source/0x2/index.d.ts +3 -0
  21. package/sdk/src/_generated/_dependencies/source/0x2/index.js +6 -0
  22. package/sdk/src/_generated/_dependencies/source/0x2/object/structs.d.ts +92 -0
  23. package/sdk/src/_generated/_dependencies/source/0x2/object/structs.js +270 -0
  24. package/sdk/src/_generated/_dependencies/source/0x2/sui/structs.d.ts +46 -0
  25. package/sdk/src/_generated/_dependencies/source/0x2/sui/structs.js +142 -0
  26. package/sdk/src/_generated/_dependencies/source/0x2/table/structs.d.ts +61 -0
  27. package/sdk/src/_generated/_dependencies/source/0x2/table/structs.js +163 -0
  28. package/sdk/src/_generated/_dependencies/source/0x2/url/structs.d.ts +53 -0
  29. package/sdk/src/_generated/_dependencies/source/0x2/url/structs.js +143 -0
  30. package/sdk/src/_generated/_dependencies/source/0x2/vec-map/structs.d.ts +111 -0
  31. package/sdk/src/_generated/_dependencies/source/0x2/vec-map/structs.js +325 -0
  32. package/sdk/src/_generated/_dependencies/source/0x3/index.d.ts +3 -0
  33. package/sdk/src/_generated/_dependencies/source/0x3/index.js +6 -0
  34. package/sdk/src/_generated/_dependencies/source/0x3/staking-pool/structs.d.ts +487 -0
  35. package/sdk/src/_generated/_dependencies/source/0x3/staking-pool/structs.js +915 -0
  36. package/sdk/src/_generated/_framework/reified.d.ts +108 -0
  37. package/sdk/src/_generated/_framework/reified.js +240 -0
  38. package/sdk/src/_generated/_framework/util.d.ts +35 -0
  39. package/sdk/src/_generated/_framework/util.js +334 -0
  40. package/sdk/src/_generated/_framework/vector.d.ts +35 -0
  41. package/sdk/src/_generated/_framework/vector.js +77 -0
  42. package/sdk/src/_generated/liquid_staking/cell/structs.d.ts +54 -0
  43. package/sdk/src/_generated/liquid_staking/cell/structs.js +156 -0
  44. package/sdk/src/_generated/liquid_staking/fees/functions.d.ts +51 -0
  45. package/sdk/src/_generated/liquid_staking/fees/functions.js +130 -0
  46. package/sdk/src/_generated/liquid_staking/fees/structs.d.ts +165 -0
  47. package/sdk/src/_generated/liquid_staking/fees/structs.js +307 -0
  48. package/sdk/src/_generated/liquid_staking/index.d.ts +4 -0
  49. package/sdk/src/_generated/liquid_staking/index.js +10 -0
  50. package/sdk/src/_generated/liquid_staking/liquid-staking/functions.d.ts +88 -0
  51. package/sdk/src/_generated/liquid_staking/liquid-staking/functions.js +199 -0
  52. package/sdk/src/_generated/liquid_staking/liquid-staking/structs.d.ts +955 -0
  53. package/sdk/src/_generated/liquid_staking/liquid-staking/structs.js +1477 -0
  54. package/sdk/src/_generated/liquid_staking/storage/structs.d.ts +358 -0
  55. package/sdk/src/_generated/liquid_staking/storage/structs.js +365 -0
  56. package/sdk/src/_generated/liquid_staking/version/structs.d.ts +46 -0
  57. package/sdk/src/_generated/liquid_staking/version/structs.js +143 -0
  58. package/sdk/src/_generated/liquid_staking/weight/functions.d.ts +19 -0
  59. package/sdk/src/_generated/liquid_staking/weight/functions.js +44 -0
  60. package/sdk/src/_generated/liquid_staking/weight/structs.d.ts +205 -0
  61. package/sdk/src/_generated/liquid_staking/weight/structs.js +332 -0
  62. package/sdk/src/index.d.ts +44 -0
  63. package/sdk/src/index.js +234 -0
@@ -0,0 +1,163 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.Table = void 0;
13
+ exports.isTable = isTable;
14
+ const reified_1 = require("../../../../_framework/reified");
15
+ const util_1 = require("../../../../_framework/util");
16
+ const index_1 = require("../index");
17
+ const structs_1 = require("../object/structs");
18
+ const bcs_1 = require("@mysten/sui/bcs");
19
+ const utils_1 = require("@mysten/sui/utils");
20
+ /* ============================== Table =============================== */
21
+ function isTable(type) {
22
+ type = (0, util_1.compressSuiType)(type);
23
+ return type.startsWith(`${index_1.PKG_V28}::table::Table` + "<");
24
+ }
25
+ class Table {
26
+ constructor(typeArgs, fields) {
27
+ this.__StructClass = true;
28
+ this.$typeName = Table.$typeName;
29
+ this.$isPhantom = Table.$isPhantom;
30
+ this.$fullTypeName = (0, util_1.composeSuiType)(Table.$typeName, ...typeArgs);
31
+ this.$typeArgs = typeArgs;
32
+ this.id = fields.id;
33
+ this.size = fields.size;
34
+ }
35
+ static reified(K, V) {
36
+ return {
37
+ typeName: Table.$typeName,
38
+ fullTypeName: (0, util_1.composeSuiType)(Table.$typeName, ...[(0, reified_1.extractType)(K), (0, reified_1.extractType)(V)]),
39
+ typeArgs: [(0, reified_1.extractType)(K), (0, reified_1.extractType)(V)],
40
+ isPhantom: Table.$isPhantom,
41
+ reifiedTypeArgs: [K, V],
42
+ fromFields: (fields) => Table.fromFields([K, V], fields),
43
+ fromFieldsWithTypes: (item) => Table.fromFieldsWithTypes([K, V], item),
44
+ fromBcs: (data) => Table.fromBcs([K, V], data),
45
+ bcs: Table.bcs,
46
+ fromJSONField: (field) => Table.fromJSONField([K, V], field),
47
+ fromJSON: (json) => Table.fromJSON([K, V], json),
48
+ fromSuiParsedData: (content) => Table.fromSuiParsedData([K, V], content),
49
+ fromSuiObjectData: (content) => Table.fromSuiObjectData([K, V], content),
50
+ fetch: (client, id) => __awaiter(this, void 0, void 0, function* () { return Table.fetch(client, [K, V], id); }),
51
+ new: (fields) => {
52
+ return new Table([(0, reified_1.extractType)(K), (0, reified_1.extractType)(V)], fields);
53
+ },
54
+ kind: "StructClassReified",
55
+ };
56
+ }
57
+ static get r() {
58
+ return Table.reified;
59
+ }
60
+ static phantom(K, V) {
61
+ return (0, reified_1.phantom)(Table.reified(K, V));
62
+ }
63
+ static get p() {
64
+ return Table.phantom;
65
+ }
66
+ static get bcs() {
67
+ return bcs_1.bcs.struct("Table", {
68
+ id: structs_1.UID.bcs,
69
+ size: bcs_1.bcs.u64(),
70
+ });
71
+ }
72
+ static fromFields(typeArgs, fields) {
73
+ return Table.reified(typeArgs[0], typeArgs[1]).new({
74
+ id: (0, reified_1.decodeFromFields)(structs_1.UID.reified(), fields.id),
75
+ size: (0, reified_1.decodeFromFields)("u64", fields.size),
76
+ });
77
+ }
78
+ static fromFieldsWithTypes(typeArgs, item) {
79
+ if (!isTable(item.type)) {
80
+ throw new Error("not a Table type");
81
+ }
82
+ (0, reified_1.assertFieldsWithTypesArgsMatch)(item, typeArgs);
83
+ return Table.reified(typeArgs[0], typeArgs[1]).new({
84
+ id: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.UID.reified(), item.fields.id),
85
+ size: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.size),
86
+ });
87
+ }
88
+ static fromBcs(typeArgs, data) {
89
+ return Table.fromFields(typeArgs, Table.bcs.parse(data));
90
+ }
91
+ toJSONField() {
92
+ return {
93
+ id: this.id,
94
+ size: this.size.toString(),
95
+ };
96
+ }
97
+ toJSON() {
98
+ return Object.assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
99
+ }
100
+ static fromJSONField(typeArgs, field) {
101
+ return Table.reified(typeArgs[0], typeArgs[1]).new({
102
+ id: (0, reified_1.decodeFromJSONField)(structs_1.UID.reified(), field.id),
103
+ size: (0, reified_1.decodeFromJSONField)("u64", field.size),
104
+ });
105
+ }
106
+ static fromJSON(typeArgs, json) {
107
+ if (json.$typeName !== Table.$typeName) {
108
+ throw new Error("not a WithTwoGenerics json object");
109
+ }
110
+ (0, reified_1.assertReifiedTypeArgsMatch)((0, util_1.composeSuiType)(Table.$typeName, ...typeArgs.map(reified_1.extractType)), json.$typeArgs, typeArgs);
111
+ return Table.fromJSONField(typeArgs, json);
112
+ }
113
+ static fromSuiParsedData(typeArgs, content) {
114
+ if (content.dataType !== "moveObject") {
115
+ throw new Error("not an object");
116
+ }
117
+ if (!isTable(content.type)) {
118
+ throw new Error(`object at ${content.fields.id} is not a Table object`);
119
+ }
120
+ return Table.fromFieldsWithTypes(typeArgs, content);
121
+ }
122
+ static fromSuiObjectData(typeArgs, data) {
123
+ if (data.bcs) {
124
+ if (data.bcs.dataType !== "moveObject" || !isTable(data.bcs.type)) {
125
+ throw new Error(`object at is not a Table object`);
126
+ }
127
+ const gotTypeArgs = (0, util_1.parseTypeName)(data.bcs.type).typeArgs;
128
+ if (gotTypeArgs.length !== 2) {
129
+ throw new Error(`type argument mismatch: expected 2 type arguments but got ${gotTypeArgs.length}`);
130
+ }
131
+ for (let i = 0; i < 2; i++) {
132
+ const gotTypeArg = (0, util_1.compressSuiType)(gotTypeArgs[i]);
133
+ const expectedTypeArg = (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArgs[i]));
134
+ if (gotTypeArg !== expectedTypeArg) {
135
+ throw new Error(`type argument mismatch at position ${i}: expected '${expectedTypeArg}' but got '${gotTypeArg}'`);
136
+ }
137
+ }
138
+ return Table.fromBcs(typeArgs, (0, utils_1.fromB64)(data.bcs.bcsBytes));
139
+ }
140
+ if (data.content) {
141
+ return Table.fromSuiParsedData(typeArgs, data.content);
142
+ }
143
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
144
+ }
145
+ static fetch(client, typeArgs, id) {
146
+ return __awaiter(this, void 0, void 0, function* () {
147
+ var _a, _b;
148
+ const res = yield client.getObject({ id, options: { showBcs: true } });
149
+ if (res.error) {
150
+ throw new Error(`error fetching Table object at id ${id}: ${res.error.code}`);
151
+ }
152
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" ||
153
+ !isTable(res.data.bcs.type)) {
154
+ throw new Error(`object at id ${id} is not a Table object`);
155
+ }
156
+ return Table.fromSuiObjectData(typeArgs, res.data);
157
+ });
158
+ }
159
+ }
160
+ exports.Table = Table;
161
+ Table.$typeName = `${index_1.PKG_V28}::table::Table`;
162
+ Table.$numTypeParams = 2;
163
+ Table.$isPhantom = [true, true];
@@ -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_V28 } 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_V28}::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,143 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
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");
20
+ /* ============================== Url =============================== */
21
+ function isUrl(type) {
22
+ type = (0, util_1.compressSuiType)(type);
23
+ return type === `${index_1.PKG_V28}::url::Url`;
24
+ }
25
+ class Url {
26
+ constructor(typeArgs, fields) {
27
+ this.__StructClass = true;
28
+ this.$typeName = Url.$typeName;
29
+ this.$isPhantom = Url.$isPhantom;
30
+ this.$fullTypeName = (0, util_1.composeSuiType)(Url.$typeName, ...typeArgs);
31
+ this.$typeArgs = typeArgs;
32
+ this.url = fields.url;
33
+ }
34
+ static reified() {
35
+ return {
36
+ typeName: Url.$typeName,
37
+ fullTypeName: (0, util_1.composeSuiType)(Url.$typeName, ...[]),
38
+ typeArgs: [],
39
+ isPhantom: Url.$isPhantom,
40
+ reifiedTypeArgs: [],
41
+ fromFields: (fields) => Url.fromFields(fields),
42
+ fromFieldsWithTypes: (item) => Url.fromFieldsWithTypes(item),
43
+ fromBcs: (data) => Url.fromBcs(data),
44
+ bcs: Url.bcs,
45
+ fromJSONField: (field) => Url.fromJSONField(field),
46
+ fromJSON: (json) => Url.fromJSON(json),
47
+ fromSuiParsedData: (content) => Url.fromSuiParsedData(content),
48
+ fromSuiObjectData: (content) => Url.fromSuiObjectData(content),
49
+ fetch: (client, id) => __awaiter(this, void 0, void 0, function* () { return Url.fetch(client, id); }),
50
+ new: (fields) => {
51
+ return new Url([], fields);
52
+ },
53
+ kind: "StructClassReified",
54
+ };
55
+ }
56
+ static get r() {
57
+ return Url.reified();
58
+ }
59
+ static phantom() {
60
+ return (0, reified_1.phantom)(Url.reified());
61
+ }
62
+ static get p() {
63
+ return Url.phantom();
64
+ }
65
+ static get bcs() {
66
+ return bcs_1.bcs.struct("Url", {
67
+ url: structs_1.String.bcs,
68
+ });
69
+ }
70
+ static fromFields(fields) {
71
+ return Url.reified().new({
72
+ url: (0, reified_1.decodeFromFields)(structs_1.String.reified(), fields.url),
73
+ });
74
+ }
75
+ static fromFieldsWithTypes(item) {
76
+ if (!isUrl(item.type)) {
77
+ throw new Error("not a Url type");
78
+ }
79
+ return Url.reified().new({
80
+ url: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.String.reified(), item.fields.url),
81
+ });
82
+ }
83
+ static fromBcs(data) {
84
+ return Url.fromFields(Url.bcs.parse(data));
85
+ }
86
+ toJSONField() {
87
+ return {
88
+ url: this.url,
89
+ };
90
+ }
91
+ toJSON() {
92
+ return Object.assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
93
+ }
94
+ static fromJSONField(field) {
95
+ return Url.reified().new({
96
+ url: (0, reified_1.decodeFromJSONField)(structs_1.String.reified(), field.url),
97
+ });
98
+ }
99
+ static fromJSON(json) {
100
+ if (json.$typeName !== Url.$typeName) {
101
+ throw new Error("not a WithTwoGenerics json object");
102
+ }
103
+ return Url.fromJSONField(json);
104
+ }
105
+ static fromSuiParsedData(content) {
106
+ if (content.dataType !== "moveObject") {
107
+ throw new Error("not an object");
108
+ }
109
+ if (!isUrl(content.type)) {
110
+ throw new Error(`object at ${content.fields.id} is not a Url object`);
111
+ }
112
+ return Url.fromFieldsWithTypes(content);
113
+ }
114
+ static fromSuiObjectData(data) {
115
+ if (data.bcs) {
116
+ if (data.bcs.dataType !== "moveObject" || !isUrl(data.bcs.type)) {
117
+ throw new Error(`object at is not a Url object`);
118
+ }
119
+ return Url.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
120
+ }
121
+ if (data.content) {
122
+ return Url.fromSuiParsedData(data.content);
123
+ }
124
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
125
+ }
126
+ static fetch(client, id) {
127
+ return __awaiter(this, void 0, void 0, function* () {
128
+ var _a, _b;
129
+ const res = yield client.getObject({ id, options: { showBcs: true } });
130
+ if (res.error) {
131
+ throw new Error(`error fetching Url object at id ${id}: ${res.error.code}`);
132
+ }
133
+ 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)) {
134
+ throw new Error(`object at id ${id} is not a Url object`);
135
+ }
136
+ return Url.fromSuiObjectData(res.data);
137
+ });
138
+ }
139
+ }
140
+ exports.Url = Url;
141
+ Url.$typeName = `${index_1.PKG_V28}::url::Url`;
142
+ Url.$numTypeParams = 0;
143
+ Url.$isPhantom = [];
@@ -0,0 +1,111 @@
1
+ import * as reified from "../../../../_framework/reified";
2
+ import { PhantomReified, Reified, StructClass, ToField, ToTypeArgument, ToTypeStr, TypeArgument } from "../../../../_framework/reified";
3
+ import { FieldsWithTypes } from "../../../../_framework/util";
4
+ import { Vector } from "../../../../_framework/vector";
5
+ import { PKG_V28 } from "../index";
6
+ import { BcsType } from "@mysten/sui/bcs";
7
+ import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
8
+ export declare function isEntry(type: string): boolean;
9
+ export interface EntryFields<K extends TypeArgument, V extends TypeArgument> {
10
+ key: ToField<K>;
11
+ value: ToField<V>;
12
+ }
13
+ export type EntryReified<K extends TypeArgument, V extends TypeArgument> = Reified<Entry<K, V>, EntryFields<K, V>>;
14
+ export declare class Entry<K extends TypeArgument, V extends TypeArgument> implements StructClass {
15
+ __StructClass: true;
16
+ static readonly $typeName = "0x2::vec_map::Entry";
17
+ static readonly $numTypeParams = 2;
18
+ static readonly $isPhantom: readonly [false, false];
19
+ readonly $typeName = "0x2::vec_map::Entry";
20
+ readonly $fullTypeName: `${typeof PKG_V28}::vec_map::Entry<${ToTypeStr<K>}, ${ToTypeStr<V>}>`;
21
+ readonly $typeArgs: [ToTypeStr<K>, ToTypeStr<V>];
22
+ readonly $isPhantom: readonly [false, false];
23
+ readonly key: ToField<K>;
24
+ readonly value: ToField<V>;
25
+ private constructor();
26
+ static reified<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(K: K, V: V): EntryReified<ToTypeArgument<K>, ToTypeArgument<V>>;
27
+ static get r(): typeof Entry.reified;
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
+ static get p(): typeof Entry.phantom;
30
+ static get bcs(): <K extends BcsType<any>, V extends BcsType<any>>(K: K, V: V) => BcsType<{
31
+ key: K extends BcsType<infer U, any> ? U : never;
32
+ value: V extends BcsType<infer U, any> ? U : never;
33
+ }, {
34
+ key: K extends BcsType<any, infer U_1> ? U_1 : never;
35
+ value: V extends BcsType<any, infer U_1> ? U_1 : never;
36
+ }>;
37
+ static fromFields<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(typeArgs: [K, V], fields: Record<string, any>): Entry<ToTypeArgument<K>, ToTypeArgument<V>>;
38
+ static fromFieldsWithTypes<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(typeArgs: [K, V], item: FieldsWithTypes): Entry<ToTypeArgument<K>, ToTypeArgument<V>>;
39
+ static fromBcs<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(typeArgs: [K, V], data: Uint8Array): Entry<ToTypeArgument<K>, ToTypeArgument<V>>;
40
+ toJSONField(): {
41
+ key: reified.ToJSON<K>;
42
+ value: reified.ToJSON<V>;
43
+ };
44
+ toJSON(): {
45
+ key: reified.ToJSON<K>;
46
+ value: reified.ToJSON<V>;
47
+ $typeName: string;
48
+ $typeArgs: [reified.ToTypeStr<K>, reified.ToTypeStr<V>];
49
+ };
50
+ static fromJSONField<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(typeArgs: [K, V], field: any): Entry<ToTypeArgument<K>, ToTypeArgument<V>>;
51
+ static fromJSON<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(typeArgs: [K, V], json: Record<string, any>): Entry<ToTypeArgument<K>, ToTypeArgument<V>>;
52
+ static fromSuiParsedData<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(typeArgs: [K, V], content: SuiParsedData): Entry<ToTypeArgument<K>, ToTypeArgument<V>>;
53
+ static fromSuiObjectData<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(typeArgs: [K, V], data: SuiObjectData): Entry<ToTypeArgument<K>, ToTypeArgument<V>>;
54
+ 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>>>;
55
+ }
56
+ export declare function isVecMap(type: string): boolean;
57
+ export interface VecMapFields<K extends TypeArgument, V extends TypeArgument> {
58
+ contents: ToField<Vector<Entry<K, V>>>;
59
+ }
60
+ export type VecMapReified<K extends TypeArgument, V extends TypeArgument> = Reified<VecMap<K, V>, VecMapFields<K, V>>;
61
+ export declare class VecMap<K extends TypeArgument, V extends TypeArgument> implements StructClass {
62
+ __StructClass: true;
63
+ static readonly $typeName = "0x2::vec_map::VecMap";
64
+ static readonly $numTypeParams = 2;
65
+ static readonly $isPhantom: readonly [false, false];
66
+ readonly $typeName = "0x2::vec_map::VecMap";
67
+ readonly $fullTypeName: `${typeof PKG_V28}::vec_map::VecMap<${ToTypeStr<K>}, ${ToTypeStr<V>}>`;
68
+ readonly $typeArgs: [ToTypeStr<K>, ToTypeStr<V>];
69
+ readonly $isPhantom: readonly [false, false];
70
+ readonly contents: ToField<Vector<Entry<K, V>>>;
71
+ private constructor();
72
+ static reified<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(K: K, V: V): VecMapReified<ToTypeArgument<K>, ToTypeArgument<V>>;
73
+ static get r(): typeof VecMap.reified;
74
+ static phantom<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(K: K, V: V): PhantomReified<ToTypeStr<VecMap<ToTypeArgument<K>, ToTypeArgument<V>>>>;
75
+ static get p(): typeof VecMap.phantom;
76
+ static get bcs(): <K extends BcsType<any>, V extends BcsType<any>>(K: K, V: V) => BcsType<{
77
+ contents: {
78
+ key: K extends BcsType<infer U, any> ? U : never;
79
+ value: V extends BcsType<infer U, any> ? U : never;
80
+ }[];
81
+ }, {
82
+ contents: Iterable<{
83
+ key: K extends BcsType<any, infer U_1> ? U_1 : never;
84
+ value: V extends BcsType<any, infer U_1> ? U_1 : never;
85
+ }> & {
86
+ length: number;
87
+ };
88
+ }>;
89
+ static fromFields<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(typeArgs: [K, V], fields: Record<string, any>): VecMap<ToTypeArgument<K>, ToTypeArgument<V>>;
90
+ static fromFieldsWithTypes<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(typeArgs: [K, V], item: FieldsWithTypes): VecMap<ToTypeArgument<K>, ToTypeArgument<V>>;
91
+ static fromBcs<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(typeArgs: [K, V], data: Uint8Array): VecMap<ToTypeArgument<K>, ToTypeArgument<V>>;
92
+ toJSONField(): {
93
+ contents: {
94
+ key: reified.ToJSON<K>;
95
+ value: reified.ToJSON<V>;
96
+ }[];
97
+ };
98
+ toJSON(): {
99
+ contents: {
100
+ key: reified.ToJSON<K>;
101
+ value: reified.ToJSON<V>;
102
+ }[];
103
+ $typeName: string;
104
+ $typeArgs: [reified.ToTypeStr<K>, reified.ToTypeStr<V>];
105
+ };
106
+ static fromJSONField<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(typeArgs: [K, V], field: any): VecMap<ToTypeArgument<K>, ToTypeArgument<V>>;
107
+ static fromJSON<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(typeArgs: [K, V], json: Record<string, any>): VecMap<ToTypeArgument<K>, ToTypeArgument<V>>;
108
+ static fromSuiParsedData<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(typeArgs: [K, V], content: SuiParsedData): VecMap<ToTypeArgument<K>, ToTypeArgument<V>>;
109
+ static fromSuiObjectData<K extends Reified<TypeArgument, any>, V extends Reified<TypeArgument, any>>(typeArgs: [K, V], data: SuiObjectData): VecMap<ToTypeArgument<K>, ToTypeArgument<V>>;
110
+ 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>>>;
111
+ }