@typemove/move 1.13.4-rc.1 → 1.13.4-rc.2

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 (45) hide show
  1. package/package.json +4 -13
  2. package/codegen/package.json +0 -5
  3. package/dist/cjs/abstract-move-coder.d.ts +0 -30
  4. package/dist/cjs/abstract-move-coder.d.ts.map +0 -1
  5. package/dist/cjs/abstract-move-coder.js +0 -312
  6. package/dist/cjs/abstract-move-coder.js.map +0 -1
  7. package/dist/cjs/account.d.ts +0 -16
  8. package/dist/cjs/account.d.ts.map +0 -1
  9. package/dist/cjs/account.js +0 -76
  10. package/dist/cjs/account.js.map +0 -1
  11. package/dist/cjs/chain-adapter.d.ts +0 -13
  12. package/dist/cjs/chain-adapter.d.ts.map +0 -1
  13. package/dist/cjs/chain-adapter.js +0 -7
  14. package/dist/cjs/chain-adapter.js.map +0 -1
  15. package/dist/cjs/codegen/abstract-codegen.d.ts +0 -52
  16. package/dist/cjs/codegen/abstract-codegen.d.ts.map +0 -1
  17. package/dist/cjs/codegen/abstract-codegen.js +0 -466
  18. package/dist/cjs/codegen/abstract-codegen.js.map +0 -1
  19. package/dist/cjs/codegen/index.d.ts +0 -2
  20. package/dist/cjs/codegen/index.d.ts.map +0 -1
  21. package/dist/cjs/codegen/index.js +0 -5
  22. package/dist/cjs/codegen/index.js.map +0 -1
  23. package/dist/cjs/index.d.ts +0 -7
  24. package/dist/cjs/index.d.ts.map +0 -1
  25. package/dist/cjs/index.js +0 -10
  26. package/dist/cjs/index.js.map +0 -1
  27. package/dist/cjs/internal-models.d.ts +0 -46
  28. package/dist/cjs/internal-models.d.ts.map +0 -1
  29. package/dist/cjs/internal-models.js +0 -10
  30. package/dist/cjs/internal-models.js.map +0 -1
  31. package/dist/cjs/package.json +0 -3
  32. package/dist/cjs/ts-type.test.d.ts +0 -2
  33. package/dist/cjs/ts-type.test.d.ts.map +0 -1
  34. package/dist/cjs/ts-type.test.js.map +0 -1
  35. package/dist/cjs/types.d.ts +0 -52
  36. package/dist/cjs/types.d.ts.map +0 -1
  37. package/dist/cjs/types.js +0 -267
  38. package/dist/cjs/types.js.map +0 -1
  39. package/dist/cjs/utils.d.ts +0 -17
  40. package/dist/cjs/utils.d.ts.map +0 -1
  41. package/dist/cjs/utils.js +0 -140
  42. package/dist/cjs/utils.js.map +0 -1
  43. package/dist/cjs/utils.test.d.ts +0 -2
  44. package/dist/cjs/utils.test.d.ts.map +0 -1
  45. package/dist/cjs/utils.test.js.map +0 -1
package/package.json CHANGED
@@ -1,20 +1,12 @@
1
1
  {
2
2
  "name": "@typemove/move",
3
- "version": "1.13.4-rc.1",
3
+ "version": "1.13.4-rc.2",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
7
- ".": {
8
- "import": "./dist/esm/index.js",
9
- "require": "./dist/cjs/index.js"
10
- },
11
- "./codegen": {
12
- "import": "./dist/esm/codegen/index.js",
13
- "require": "./dist/cjs/codegen/index.js"
14
- }
7
+ ".": "./dist/esm/index.js",
8
+ "./codegen": "./dist/esm/codegen/index.js"
15
9
  },
16
- "main": "./dist/cjs/index.js",
17
- "module": "./dist/esm/index.js",
18
10
  "files": [
19
11
  "**/package.json",
20
12
  "{dist,src}",
@@ -26,8 +18,7 @@
26
18
  },
27
19
  "url": "https://github.com/sentioxyz/typemove",
28
20
  "scripts": {
29
- "build": "tsc && pnpm build:cjs",
30
- "build:cjs": "tsc --project tsconfig.cjs.json && cp ../../package.cjs.json ./dist/cjs/package.json",
21
+ "build": "tsc",
31
22
  "test": "glob -c 'tsx --test' '**/*.test.ts'"
32
23
  }
33
24
  }
@@ -1,5 +0,0 @@
1
- {
2
- "private": true,
3
- "main": "../dist/cjs/codegen/index.js",
4
- "module": "../dist/esm/codegen/index.js"
5
- }
@@ -1,30 +0,0 @@
1
- import { DecodedStruct, TypeDescriptor } from './types.js';
2
- import { InternalMoveEnum, InternalMoveFunction, InternalMoveModule, InternalMoveStruct } from './internal-models.js';
3
- import { ChainAdapter } from './chain-adapter.js';
4
- export declare abstract class AbstractMoveCoder<ModuleType, StructType> {
5
- protected moduleMapping: Map<string, InternalMoveModule>;
6
- protected accounts: Set<string>;
7
- private typeMapping;
8
- private enumMapping;
9
- private funcMapping;
10
- adapter: ChainAdapter<ModuleType, StructType>;
11
- protected constructor(adapter: ChainAdapter<ModuleType, StructType>);
12
- contains(account: string, name: string): boolean;
13
- abstract load(module: ModuleType, address: string): InternalMoveModule;
14
- protected loadInternal(module: InternalMoveModule, address: string): void;
15
- private _loadInternal;
16
- protected decodeBigInt(data: any): bigint;
17
- private requestMap;
18
- getMoveStruct(type: string): Promise<InternalMoveStruct>;
19
- maybeGetMoveEnum(type: string): Promise<InternalMoveEnum | undefined>;
20
- getMoveFunction(type: string): Promise<InternalMoveFunction>;
21
- protected decode<T>(data: any, type: TypeDescriptor<T>): Promise<T>;
22
- decodeArray(entries: any[], types: TypeDescriptor[], strict?: boolean): Promise<any[]>;
23
- encode(data: any): any;
24
- encodeArray(entriesDecoded: any[]): any[];
25
- decodeCallResult(res: any[], func: string): Promise<any[]>;
26
- filterAndDecodeStruct<T, ST extends StructType>(typeMatcher: TypeDescriptor<T>, structsWithTags: ST[]): Promise<DecodedStruct<ST, T>[]>;
27
- protected decodedStruct<T, ST extends StructType>(typeStruct: ST): Promise<DecodedStruct<ST, T> | undefined>;
28
- decodeType<T, ST>(typeStruct: ST, type: TypeDescriptor<T>): Promise<T | undefined>;
29
- }
30
- //# sourceMappingURL=abstract-move-coder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"abstract-move-coder.d.ts","sourceRoot":"","sources":["../../src/abstract-move-coder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAA4B,cAAc,EAAE,MAAM,YAAY,CAAA;AACpF,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAErH,OAAO,EAAE,YAA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AG,GAAG;IAqB7B,WAAW,CAAC,cAAc,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE;IAQnC,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAK1D,qBAAqB,CAAC,CAAC,EAAE,EAAE,SAAS,UAAU,EAClD,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC,EAC9B,eAAe,EAAE,EAAE,EAAE,GACpB,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC;cAuBlB,aAAa,CAAC,CAAC,EAAE,EAAE,SAAS,UAAU,EAAE,UAAU,EAAE,EAAE,GAAG,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,SAAS,CAAC;IAkBrG,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;CAgBhG"}
@@ -1,312 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AbstractMoveCoder = void 0;
4
- const utils_js_1 = require("./utils.js");
5
- const types_js_1 = require("./types.js");
6
- class AbstractMoveCoder {
7
- moduleMapping = new Map();
8
- accounts = new Set();
9
- typeMapping = new Map();
10
- enumMapping = new Map();
11
- funcMapping = new Map();
12
- // network: string
13
- adapter;
14
- constructor(adapter) {
15
- this.adapter = adapter;
16
- }
17
- contains(account, name) {
18
- return this.moduleMapping.has((0, utils_js_1.moduleQname)({ address: account, name }));
19
- }
20
- loadInternal(module, address) {
21
- const account = module.address;
22
- const declareAccount = (0, utils_js_1.accountTypeString)(address);
23
- this._loadInternal(module, account);
24
- if (account !== declareAccount) {
25
- this._loadInternal(module, declareAccount);
26
- }
27
- }
28
- _loadInternal(module, account) {
29
- if (this.contains(account, module.name)) {
30
- return;
31
- }
32
- this.moduleMapping.set((0, utils_js_1.moduleQname)({ address: account, name: module.name }), module);
33
- for (const enumType of module.enums) {
34
- const key = [account, module.name, enumType.name].join(utils_js_1.SPLITTER);
35
- this.enumMapping.set(key, enumType);
36
- }
37
- for (const struct of module.structs) {
38
- // TODO move to util
39
- const key = [account, module.name, struct.name].join(utils_js_1.SPLITTER);
40
- this.typeMapping.set(key, struct);
41
- }
42
- for (const func of module.exposedFunctions) {
43
- // if (!func.isEntry) {
44
- // continue
45
- // }
46
- const key = [account, module.name, func.name].join(utils_js_1.SPLITTER);
47
- this.funcMapping.set(key, func);
48
- }
49
- }
50
- decodeBigInt(data) {
51
- if (Array.isArray(data)) {
52
- throw new Error('data is in byte array');
53
- // Only sui function need this, strange
54
- // const bytes = data as number[]
55
- // return bytesToBigInt(new Uint8Array(bytes.slice().reverse()))
56
- }
57
- return BigInt(data);
58
- }
59
- requestMap = new Map();
60
- async getMoveStruct(type) {
61
- const [account_, module, typeName] = type.split(utils_js_1.SPLITTER);
62
- const account = (0, utils_js_1.accountTypeString)(account_);
63
- type = [account, module, typeName].join(utils_js_1.SPLITTER);
64
- let struct = this.typeMapping.get(type);
65
- if (struct) {
66
- return struct;
67
- }
68
- if (this.accounts.has(account)) {
69
- throw new Error('Failed to load struct ' + type + ' for imported account');
70
- }
71
- let resp = this.requestMap.get(account);
72
- if (!resp) {
73
- resp = this.adapter.fetchModules(account).then((modules) => {
74
- for (const m of modules) {
75
- this.load(m, account);
76
- }
77
- });
78
- this.requestMap.set(account, resp);
79
- }
80
- await resp;
81
- struct = this.typeMapping.get(type);
82
- if (struct) {
83
- return struct;
84
- }
85
- throw new Error('Failed to load function ' + type + ' type are not imported anywhere');
86
- }
87
- async maybeGetMoveEnum(type) {
88
- const [account_, module, typeName] = type.split(utils_js_1.SPLITTER);
89
- const account = (0, utils_js_1.accountTypeString)(account_);
90
- type = [account, module, typeName].join(utils_js_1.SPLITTER);
91
- let enumType = this.enumMapping.get(type);
92
- if (enumType) {
93
- return enumType;
94
- }
95
- if (this.accounts.has(account)) {
96
- return undefined;
97
- }
98
- let resp = this.requestMap.get(account);
99
- if (!resp) {
100
- resp = this.adapter.fetchModules(account).then((modules) => {
101
- for (const m of modules) {
102
- this.load(m, account);
103
- }
104
- });
105
- this.requestMap.set(account, resp);
106
- }
107
- await resp;
108
- enumType = this.enumMapping.get(type);
109
- if (enumType) {
110
- return enumType;
111
- }
112
- return undefined;
113
- }
114
- async getMoveFunction(type) {
115
- const [account_, module, typeName] = type.split(utils_js_1.SPLITTER);
116
- const account = (0, utils_js_1.accountTypeString)(account_);
117
- type = [account, module, typeName].join(utils_js_1.SPLITTER);
118
- let func = this.funcMapping.get(type);
119
- if (func) {
120
- return func;
121
- }
122
- if (this.accounts.has(account)) {
123
- throw new Error('Failed to load function ' + type + ' for imported account');
124
- }
125
- let resp = this.requestMap.get(account);
126
- if (!resp) {
127
- resp = this.adapter
128
- .fetchModules(account)
129
- .then((modules) => {
130
- for (const m of modules) {
131
- this.load(m, account);
132
- }
133
- })
134
- .catch((e) => {
135
- this.requestMap.delete(account);
136
- });
137
- this.requestMap.set(account, resp);
138
- }
139
- await resp;
140
- func = this.funcMapping.get(type);
141
- if (func) {
142
- return func;
143
- }
144
- throw new Error('Failed to load function ' + type + ' type are not imported anywhere');
145
- }
146
- async decode(data, type) {
147
- // process simple type
148
- if (type.reference) {
149
- return data;
150
- }
151
- switch (type.qname) {
152
- case 'signer': // TODO check this, aptos only
153
- case 'address':
154
- case 'Address':
155
- case '0x1::string::String':
156
- case 'bool':
157
- case 'Bool':
158
- case 'u8':
159
- case 'U8':
160
- case 'u16':
161
- case 'U16':
162
- case 'u32':
163
- case 'U32':
164
- return data;
165
- case 'u64':
166
- case 'U64':
167
- case 'u128':
168
- case 'U128':
169
- case 'u256':
170
- case 'U256':
171
- return this.decodeBigInt(data);
172
- }
173
- // process vector
174
- if (type.qname.toLowerCase() === utils_js_1.VECTOR_STR) {
175
- // vector<u8> as hex string
176
- if (type.typeArgs[0].qname === 'u8' || type.typeArgs[0].qname === 'U8') {
177
- return data;
178
- }
179
- const res = [];
180
- for (const entry of data) {
181
- res.push(await this.decode(entry, type.typeArgs[0]));
182
- }
183
- return res;
184
- }
185
- // try enum type first
186
- const enumType = await this.maybeGetMoveEnum(type.qname);
187
- if (enumType) {
188
- return data;
189
- }
190
- // Process complex type
191
- const struct = await this.getMoveStruct(type.qname);
192
- const typeCtx = new Map();
193
- for (const [idx, typeArg] of type.typeArgs.entries()) {
194
- typeCtx.set('T' + idx, typeArg);
195
- }
196
- const typedData = {};
197
- for (const field of struct.fields) {
198
- let filedType = field.type;
199
- filedType = filedType.applyTypeArgs(typeCtx);
200
- const fieldValue = this.adapter.getData(data)[field.name];
201
- const value = await this.decode(fieldValue, filedType);
202
- typedData[field.name] = value;
203
- }
204
- return typedData;
205
- }
206
- async decodeArray(entries, types, strict = true) {
207
- const entriesDecoded = [];
208
- for (const [idx, arg] of entries.entries()) {
209
- // TODO consider apply payload.type_arguments, but this might be hard since we don't code gen for them
210
- const argType = types[idx];
211
- try {
212
- if (!strict && arg === undefined) {
213
- entriesDecoded.push(arg);
214
- }
215
- else {
216
- entriesDecoded.push(await this.decode(arg, argType));
217
- }
218
- }
219
- catch (e) {
220
- throw Error('Decoding error for ' + JSON.stringify(arg) + 'using type' + argType + e.toString());
221
- }
222
- }
223
- return entriesDecoded;
224
- }
225
- encode(data) {
226
- if (data === undefined || data === null) {
227
- return undefined;
228
- }
229
- if (typeof data === 'bigint') {
230
- return data.toString();
231
- }
232
- if (Array.isArray(data)) {
233
- return this.encodeArray(data);
234
- }
235
- for (const [key, value] of Object.entries(data)) {
236
- if (!value) {
237
- continue;
238
- }
239
- if (typeof value === 'bigint') {
240
- data[key] = value.toString();
241
- }
242
- }
243
- return data;
244
- }
245
- encodeArray(entriesDecoded) {
246
- const entries = [];
247
- for (const [idx, arg] of entriesDecoded.entries()) {
248
- entries.push(this.encode(arg));
249
- }
250
- return entries;
251
- }
252
- async decodeCallResult(res, func) {
253
- const f = await this.getMoveFunction(func);
254
- return this.decodeArray(res, f.return);
255
- }
256
- async filterAndDecodeStruct(typeMatcher, structsWithTags) {
257
- if (!structsWithTags) {
258
- return [];
259
- }
260
- // const typeMatcherDescriptor = parseMoveType(typeMatcher)
261
- const results = [];
262
- for (const resource of structsWithTags) {
263
- const resourceType = this.adapter.getType(resource);
264
- const resourceTypeDescriptor = (0, types_js_1.parseMoveType)(resourceType);
265
- if (!(0, types_js_1.matchType)(typeMatcher, resourceTypeDescriptor)) {
266
- continue;
267
- }
268
- const result = await this.decodedStruct(resource);
269
- if (result) {
270
- results.push(result);
271
- }
272
- else {
273
- console.error('decoding error');
274
- }
275
- }
276
- return results;
277
- }
278
- async decodedStruct(typeStruct) {
279
- const typeDescriptor = (0, types_js_1.parseMoveType)(this.adapter.getType(typeStruct));
280
- const typeArguments = typeDescriptor.typeArgs.map((t) => t.getSignature());
281
- let dataTyped = undefined;
282
- try {
283
- dataTyped = await this.decode(typeStruct, typeDescriptor);
284
- }
285
- catch (e) {
286
- throw Error('Decoding error for struct' + JSON.stringify(typeStruct) + e.toString());
287
- // return undefined
288
- }
289
- return {
290
- ...typeStruct,
291
- data_decoded: dataTyped,
292
- type_arguments: typeArguments
293
- };
294
- }
295
- async decodeType(typeStruct, type) {
296
- if (typeStruct === null || typeStruct == undefined) {
297
- return typeStruct;
298
- }
299
- if (typeof typeStruct === 'object') {
300
- if ('type' in typeStruct) {
301
- const typeInStruct = (0, types_js_1.parseMoveType)(typeStruct.type.toString() || '');
302
- if (!(0, types_js_1.matchType)(type, typeInStruct)) {
303
- return undefined;
304
- }
305
- type = typeInStruct;
306
- }
307
- }
308
- return await this.decode(typeStruct, type);
309
- }
310
- }
311
- exports.AbstractMoveCoder = AbstractMoveCoder;
312
- //# sourceMappingURL=abstract-move-coder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"abstract-move-coder.js","sourceRoot":"","sources":["../../src/abstract-move-coder.ts"],"names":[],"mappings":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AQ,EAAE,IAAI,EAAE,CAAC,CAAA;gBAC7E,IAAI,CAAC,IAAA,oBAAS,EAAC,IAAI,EAAE,YAAY,CAAC,EAAE,CAAC;oBACnC,OAAO,SAAS,CAAA;gBAClB,CAAC;gBACD,IAAI,GAAG,YAAY,CAAA;YACrB,CAAC;QACH,CAAC;QAED,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;IAC5C,CAAC;CACF;AApVD,8CAoVC"}
@@ -1,16 +0,0 @@
1
- import { InternalMoveModule } from './internal-models.js';
2
- export declare class AccountModulesImportInfo {
3
- imports: Map<string, Set<string>>;
4
- account: string;
5
- moduleName: string;
6
- constructor(account: string, tsModuleName: string);
7
- addImport(account: string, module: string): void;
8
- }
9
- export declare class AccountRegister {
10
- accountImports: Map<string, AccountModulesImportInfo>;
11
- pendingAccounts: Set<string>;
12
- register(module: InternalMoveModule, tsModuleName: string): AccountModulesImportInfo;
13
- private registerFunctions;
14
- private registerStruct;
15
- }
16
- //# sourceMappingURL=account.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/account.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAEzD,qBAAa,wBAAwB;IAEnC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;IACjC,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;gBAEN,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;IAMjD,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAW1C;AAED,qBAAa,eAAe;IAC1B,cAAc,wCAA8C;IAC5D,eAAe,cAAoB;IAEnC,QAAQ,CAAC,MAAM,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,GAAG,wBAAwB;IAkBpF,OAAO,CAAC,iBAAiB;IAiBzB,OAAO,CAAC,cAAc;CAavB"}
@@ -1,76 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AccountRegister = exports.AccountModulesImportInfo = void 0;
4
- const utils_js_1 = require("./utils.js");
5
- class AccountModulesImportInfo {
6
- // account to module
7
- imports;
8
- account;
9
- moduleName;
10
- constructor(account, tsModuleName) {
11
- this.account = account;
12
- this.moduleName = tsModuleName;
13
- this.imports = new Map();
14
- }
15
- addImport(account, module) {
16
- if (account === this.account) {
17
- return;
18
- }
19
- let accountModules = this.imports.get(account);
20
- if (!accountModules) {
21
- accountModules = new Set();
22
- this.imports.set(account, accountModules);
23
- }
24
- accountModules.add(module);
25
- }
26
- }
27
- exports.AccountModulesImportInfo = AccountModulesImportInfo;
28
- class AccountRegister {
29
- accountImports = new Map();
30
- pendingAccounts = new Set();
31
- register(module, tsModuleName) {
32
- const currentModuleFqn = (0, utils_js_1.moduleQname)(module);
33
- let accountModuleImports = this.accountImports.get(module.address);
34
- if (!accountModuleImports) {
35
- accountModuleImports = new AccountModulesImportInfo(module.address, tsModuleName);
36
- this.accountImports.set(module.address, accountModuleImports);
37
- // the account has already be processed, delete pending task
38
- this.pendingAccounts.delete(module.address);
39
- }
40
- this.registerStruct(module, accountModuleImports);
41
- this.registerFunctions(module, accountModuleImports);
42
- this.accountImports.set(currentModuleFqn, accountModuleImports);
43
- return accountModuleImports;
44
- }
45
- registerFunctions(module, accountModuleImports) {
46
- for (const func of module.exposedFunctions) {
47
- // if (!func.isEntry) {
48
- // continue
49
- // }
50
- for (const param of func.params.concat(func.return)) {
51
- for (const type of param.dependedTypes()) {
52
- const [account, module] = (0, utils_js_1.moduleQnameForType)(type);
53
- accountModuleImports.addImport(account, module);
54
- if (!this.accountImports.has(account)) {
55
- this.pendingAccounts.add(account);
56
- }
57
- }
58
- }
59
- }
60
- }
61
- registerStruct(module, accountModuleImports) {
62
- for (const struct of module.structs) {
63
- for (const field of struct.fields) {
64
- for (const type of field.type.dependedTypes()) {
65
- const [account, module] = (0, utils_js_1.moduleQnameForType)(type);
66
- accountModuleImports.addImport(account, module);
67
- if (!this.accountImports.has(account)) {
68
- this.pendingAccounts.add(account);
69
- }
70
- }
71
- }
72
- }
73
- }
74
- }
75
- exports.AccountRegister = AccountRegister;
76
- //# sourceMappingURL=account.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/account.ts"],"names":[],"mappings":";;;AAAA,yCAA4D;AAG5D,MAAa,wBAAwB;IACnC,oBAAoB;IACpB,OAAO,CAA0B;IACjC,OAAO,CAAQ;IACf,UAAU,CAAQ;IAElB,YAAY,OAAe,EAAE,YAAoB;QAC/C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,UAAU,GAAG,YAAY,CAAA;QAC9B,IAAI,CAAC,OAAO,GAAG,IAAI,GAAG,EAAuB,CAAA;IAC/C,CAAC;IAED,SAAS,CAAC,OAAe,EAAE,MAAc;QACvC,IAAI,OAAO,KAAK,IAAI,CAAC,OAAO,EAAE,CAAC;YAC7B,OAAM;QACR,CAAC;QACD,IAAI,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QAC9C,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,cAAc,GAAG,IAAI,GAAG,EAAU,CAAA;YAClC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,cAAc,CAAC,CAAA;QAC3C,CAAC;QACD,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IAC5B,CAAC;CACF;AAvBD,4DAuBC;AAED,MAAa,eAAe;IAC1B,cAAc,GAAG,IAAI,GAAG,EAAoC,CAAA;IAC5D,eAAe,GAAG,IAAI,GAAG,EAAU,CAAA;IAEnC,QAAQ,CAAC,MAA0B,EAAE,YAAoB;QACvD,MAAM,gBAAgB,GAAG,IAAA,sBAAW,EAAC,MAAM,CAAC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C,GAAG,CAAC,OAAO,CAAC,CAAA;oBACnC,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAEO,cAAc,CAAC,MAA0B,EAAE,oBAA8C;QAC/F,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACpC,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;gBAClC,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,CAAC;oBAC9C,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,IAAA,6BAAkB,EAAC,IAAI,CAAC,CAAA;oBAClD,oBAAoB,CAAC,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;oBAC/C,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;wBACtC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;oBACnC,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;CACF;AApDD,0CAoDC"}
@@ -1,13 +0,0 @@
1
- import { InternalMoveModule, InternalMoveStruct } from './internal-models.js';
2
- import { TypeDescriptor } from './types.js';
3
- export declare abstract class ChainAdapter<ModuleType, StructType> {
4
- abstract getChainId(): Promise<string>;
5
- abstract fetchModule(account: string, module: string): Promise<ModuleType>;
6
- abstract fetchModules(account: string): Promise<ModuleType[]>;
7
- abstract toInternalModules(modules: ModuleType[]): InternalMoveModule[];
8
- abstract getAllEventStructs(module: InternalMoveModule[]): Map<string, InternalMoveStruct>;
9
- abstract getMeaningfulFunctionParams(params: TypeDescriptor[]): TypeDescriptor[];
10
- abstract getType(base: StructType): string;
11
- abstract getData<T>(base: StructType): any;
12
- }
13
- //# sourceMappingURL=chain-adapter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chain-adapter.d.ts","sourceRoot":"","sources":["../../src/chain-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE3C,8BAAsB,YAAY,CAAC,UAAU,EAAE,UAAU;IAMvD,QAAQ,CAAC,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;IAEtC,QAAQ,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAE1E,QAAQ,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAC7D,QAAQ,CAAC,iBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,kBAAkB,EAAE;IAGvE,QAAQ,CAAC,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC;IAI1F,QAAQ,CAAC,2BAA2B,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE;IAEhF,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM;IAC1C,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,GAAG,GAAG;CAC3C"}
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ChainAdapter = void 0;
4
- class ChainAdapter {
5
- }
6
- exports.ChainAdapter = ChainAdapter;
7
- //# sourceMappingURL=chain-adapter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chain-adapter.js","sourceRoot":"","sources":["../../src/chain-adapter.ts"],"names":[],"mappings":";;;AAGA,MAAsB,YAAY;CAsBjC;AAtBD,oCAsBC"}
@@ -1,52 +0,0 @@
1
- import { InternalMoveEnum, InternalMoveFunction, InternalMoveModule, InternalMoveStruct } from '../internal-models.js';
2
- import { AccountRegister } from '../account.js';
3
- import { TypeDescriptor } from '../types.js';
4
- import { ChainAdapter } from '../chain-adapter.js';
5
- interface OutputFile {
6
- fileName: string;
7
- fileContent: string;
8
- }
9
- interface Config {
10
- fileName: string;
11
- outputDir: string;
12
- }
13
- export declare abstract class AbstractCodegen<ModuleTypes, StructType> {
14
- ADDRESS_TYPE: string;
15
- SYSTEM_PACKAGE: string;
16
- PREFIX: string;
17
- STRUCT_FIELD_NAME: string;
18
- PAYLOAD_OPTIONAL: boolean;
19
- SYSTEM_MODULES: Set<string>;
20
- ESM: boolean;
21
- chainAdapter: ChainAdapter<ModuleTypes, StructType>;
22
- protected constructor(chainAdapter: ChainAdapter<ModuleTypes, StructType>);
23
- maybeEsmPrefix(): "" | ".js";
24
- readModulesFile(fullPath: string): any;
25
- protected defaultCoderPackage(): string;
26
- generateLoadAll(isSystem: boolean): string;
27
- generate(srcDir: string, outputDir: string, builtin?: boolean): Promise<number>;
28
- protected generateExtra(address: string | undefined, module: InternalMoveModule): string;
29
- generateModule(module: InternalMoveModule, allEventStructs: Map<string, InternalMoveStruct>, addressOverride?: string): string;
30
- generateEnum(module: InternalMoveModule, enumType: InternalMoveEnum): string;
31
- generateStructs(module: InternalMoveModule, struct: InternalMoveStruct, events: Set<string>, typeOnly?: boolean): string;
32
- generateFunctionTypeParameters(func: InternalMoveFunction): string;
33
- generateFunctionReturnTypeParameters(func: InternalMoveFunction, currentAddress: string): string;
34
- generateStructTypeParameters(struct: InternalMoveStruct | InternalMoveEnum, useAny?: boolean): string;
35
- generateCallArgsStructs(module: InternalMoveModule, func: InternalMoveFunction): string;
36
- generateForEvents(module: InternalMoveModule, struct: InternalMoveStruct): string;
37
- generateTypeForDescriptor(type: TypeDescriptor, currentAddress: string): string;
38
- generateSimpleType(type: string, currentAddress: string): string;
39
- generateImports(): string;
40
- }
41
- export declare class AccountCodegen<ModuleType, StructType> {
42
- modules: InternalMoveModule[];
43
- config: Config;
44
- abi: ModuleType[];
45
- loader: AccountRegister;
46
- moduleGen: AbstractCodegen<ModuleType, StructType>;
47
- address?: string;
48
- constructor(moduleGen: AbstractCodegen<ModuleType, StructType>, loader: AccountRegister, abi: ModuleType[], modules: InternalMoveModule[], config: Config, address: string | undefined);
49
- generate(): OutputFile[];
50
- }
51
- export {};
52
- //# sourceMappingURL=abstract-codegen.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"abstract-codegen.d.ts","sourceRoot":"","sources":["../../../src/codegen/abstract-codegen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAGtH,OAAO,EAA4B,eAAe,EAAE,MAAM,eAAe,CAAA;AAGzE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAElD,UAAU,UAAU;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,UAAU,MAAM;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;CAElB;AAGD,8BAAsB,eAAe,CAAC,WAAW,EAAE,UAAU;IAC3D,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,MAAM,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,iBAAiB,EAAE,MAAM,CAAS;IAClC,gBAAgB,UAAQ;IACxB,cAAc,cAAwC;IACtD,GAAG,UAAO;IAEV,YAAY,EAAE,YAAY,CAAC,WAAW,EAAE,UAAU,CAAC,CAAA;IAEnD,SAAS,aAAa,YAAY,EAAE,YAAY,CAAC,WAAW,EAAE,UAAU,CAAC;IAIlE,cAAc;IAIrB,eAAe,CAAC,QAAQ,EAAE,MAAM;IAIhC,SAAS,CAAC,mBAAmB;IAI7B,eAAe,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM;IAIpC,Q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