@typemove/sui 1.0.0-rc.12 → 1.0.0-rc.14
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.
- package/dist/codegen/codegen.d.ts.map +1 -1
- package/dist/codegen/codegen.js +2 -2
- package/dist/codegen/codegen.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/codegen/codegen.ts +15 -51
- package/src/index.ts +0 -2
- package/dist/module-client.d.ts +0 -8
- package/dist/module-client.d.ts.map +0 -1
- package/dist/module-client.js +0 -15
- package/dist/module-client.js.map +0 -1
- package/src/module-client.ts +0 -23
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../../src/codegen/codegen.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../../src/codegen/codegen.ts"],"names":[],"mappings":"AAiBA,wBAAsB,OAAO,CAC3B,OAAO,EAAE,MAAM,EACf,MAAM,oBAA8B,EACpC,QAAQ,EAAE,MAAM,EAChB,UAAU,UAAQ,EAClB,OAAO,UAAQ,iBAQhB"}
|
package/dist/codegen/codegen.js
CHANGED
|
@@ -51,7 +51,7 @@ class SuiCodegen extends AbstractCodegen {
|
|
|
51
51
|
content += `export type Option<T> = T | undefined`;
|
|
52
52
|
break;
|
|
53
53
|
}
|
|
54
|
-
return
|
|
54
|
+
return content + super.generateStructs(module, struct, events, content !== '');
|
|
55
55
|
}
|
|
56
56
|
generateForEvents(module, struct) {
|
|
57
57
|
switch (structQname(module, struct)) {
|
|
@@ -65,7 +65,7 @@ class SuiCodegen extends AbstractCodegen {
|
|
|
65
65
|
}
|
|
66
66
|
return super.generateForEvents(module, struct);
|
|
67
67
|
}
|
|
68
|
-
|
|
68
|
+
generateExtra(module) {
|
|
69
69
|
const funcs = module.exposedFunctions.map((f) => this.generateBuilderForFunction(module, f));
|
|
70
70
|
const viewFuncs = module.exposedFunctions.map((f) => this.generateViewFunction(module, f));
|
|
71
71
|
return `
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codegen.js","sourceRoot":"","sources":["../../src/codegen/codegen.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"codegen.js","sourceRoot":"","sources":["../../src/codegen/codegen.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAGL,eAAe,EACf,WAAW,EAEX,8BAA8B,EAC9B,iBAAiB,EACjB,KAAK,GACN,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAEzD,MAAM,CAAC,KAAK,UAAU,OAAO,CAC3B,OAAe,EACf,MAAM,GAAG,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,EACpC,QAAgB,EAChB,UAAU,GAAG,KAAK,EAClB,OAAO,GAAG,KAAK;IAEf,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;QAC3B,OAAM;KACP;IACD,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAA;IACpC,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,aAAa,QAAQ,UAAU,CAAC,CAAC,CAAA;AAC3D,CAAC;AAED,MAAM,UAAW,SAAQ,eAIxB;IACC,YAAY,GAAG,YAAY,CAAA;IAC3B,cAAc,GAAG,UAAU,CAAA;IAC3B,cAAc,GAAG,gBAAgB,CAAA;IACjC,0BAA0B;IAC1B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,CAAC,IAAI;;UAErD,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,mBAAmB,iBAAiB,GAAG,CAAC,CAAC,CAAC,EAAE;;MAE1E,CAAA;IACJ,CAAC;IAED,eAAe;QACb,OAAO;QACH,KAAK,CAAC,eAAe,EAAE;;;KAG1B,CAAA;IACH,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAE3B,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAG1D,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAE3B,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAG1D,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAG3B,gDAAgD;AAEhD,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAG3B,gDAAgD;AAEhD,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typemove/sui",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.14",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@mysten/sui.js": "^0.37.1",
|
|
31
31
|
"chalk": "^5.2.0",
|
|
32
32
|
"radash": "^11.0.0",
|
|
33
|
-
"@typemove/move": "1.0.0-rc.
|
|
33
|
+
"@typemove/move": "1.0.0-rc.14"
|
|
34
34
|
},
|
|
35
35
|
"url": "https://github.com/sentioxyz/typemove",
|
|
36
36
|
"scripts": {
|
package/src/codegen/codegen.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SuiMoveNormalizedModule,
|
|
3
|
-
SuiEvent,
|
|
4
|
-
SuiMoveObject,
|
|
5
|
-
} from '@mysten/sui.js'
|
|
1
|
+
import { SuiMoveNormalizedModule, SuiEvent, SuiMoveObject } from '@mysten/sui.js'
|
|
6
2
|
|
|
7
3
|
import * as fs from 'fs'
|
|
8
4
|
import chalk from 'chalk'
|
|
@@ -62,11 +58,7 @@ class SuiCodegen extends AbstractCodegen<
|
|
|
62
58
|
return res
|
|
63
59
|
}
|
|
64
60
|
|
|
65
|
-
generateStructs(
|
|
66
|
-
module: InternalMoveModule,
|
|
67
|
-
struct: InternalMoveStruct,
|
|
68
|
-
events: Set<string>
|
|
69
|
-
): string {
|
|
61
|
+
generateStructs(module: InternalMoveModule, struct: InternalMoveStruct, events: Set<string>): string {
|
|
70
62
|
let content = ''
|
|
71
63
|
switch (structQname(module, struct)) {
|
|
72
64
|
// TODO they should still have module code generated
|
|
@@ -85,15 +77,10 @@ class SuiCodegen extends AbstractCodegen<
|
|
|
85
77
|
content += `export type Option<T> = T | undefined`
|
|
86
78
|
break
|
|
87
79
|
}
|
|
88
|
-
return (
|
|
89
|
-
content + super.generateStructs(module, struct, events, content !== '')
|
|
90
|
-
)
|
|
80
|
+
return content + super.generateStructs(module, struct, events, content !== '')
|
|
91
81
|
}
|
|
92
82
|
|
|
93
|
-
generateForEvents(
|
|
94
|
-
module: InternalMoveModule,
|
|
95
|
-
struct: InternalMoveStruct
|
|
96
|
-
): string {
|
|
83
|
+
generateForEvents(module: InternalMoveModule, struct: InternalMoveStruct): string {
|
|
97
84
|
switch (structQname(module, struct)) {
|
|
98
85
|
case '0x1::ascii::Char':
|
|
99
86
|
case '0x1::ascii::String':
|
|
@@ -106,14 +93,10 @@ class SuiCodegen extends AbstractCodegen<
|
|
|
106
93
|
return super.generateForEvents(module, struct)
|
|
107
94
|
}
|
|
108
95
|
|
|
109
|
-
protected
|
|
110
|
-
const funcs = module.exposedFunctions.map((f) =>
|
|
111
|
-
this.generateBuilderForFunction(module, f)
|
|
112
|
-
)
|
|
96
|
+
protected generateExtra(module: InternalMoveModule): string {
|
|
97
|
+
const funcs = module.exposedFunctions.map((f) => this.generateBuilderForFunction(module, f))
|
|
113
98
|
|
|
114
|
-
const viewFuncs = module.exposedFunctions.map((f) =>
|
|
115
|
-
this.generateViewFunction(module, f)
|
|
116
|
-
)
|
|
99
|
+
const viewFuncs = module.exposedFunctions.map((f) => this.generateViewFunction(module, f))
|
|
117
100
|
|
|
118
101
|
return `
|
|
119
102
|
export namespace builder {
|
|
@@ -143,10 +126,7 @@ class SuiCodegen extends AbstractCodegen<
|
|
|
143
126
|
})
|
|
144
127
|
} else {
|
|
145
128
|
args.push({
|
|
146
|
-
paramType: `${this.generateTypeForDescriptor(
|
|
147
|
-
arg,
|
|
148
|
-
module.address
|
|
149
|
-
)} | TransactionArgument`,
|
|
129
|
+
paramType: `${this.generateTypeForDescriptor(arg, module.address)} | TransactionArgument`,
|
|
150
130
|
callValue: `_args.push(TransactionArgument.is(args[${idx}]) ? args[${idx}] : tx.pure(args[${idx}]))`,
|
|
151
131
|
})
|
|
152
132
|
}
|
|
@@ -154,10 +134,7 @@ class SuiCodegen extends AbstractCodegen<
|
|
|
154
134
|
return args
|
|
155
135
|
}
|
|
156
136
|
|
|
157
|
-
protected generateViewFunction(
|
|
158
|
-
module: InternalMoveModule,
|
|
159
|
-
func: InternalMoveFunction
|
|
160
|
-
): string {
|
|
137
|
+
protected generateViewFunction(module: InternalMoveModule, func: InternalMoveFunction): string {
|
|
161
138
|
if (func.visibility !== InternalMoveFunctionVisibility.PUBLIC) {
|
|
162
139
|
return ''
|
|
163
140
|
}
|
|
@@ -171,16 +148,12 @@ class SuiCodegen extends AbstractCodegen<
|
|
|
171
148
|
|
|
172
149
|
const args = this.generateArgs(module, func)
|
|
173
150
|
|
|
174
|
-
return `export async function ${camel(
|
|
175
|
-
normalizeToJSName(func.name)
|
|
176
|
-
)}${genericString}(
|
|
151
|
+
return `export async function ${camel(normalizeToJSName(func.name))}${genericString}(
|
|
177
152
|
provider: JsonRpcProvider,
|
|
178
153
|
args: [${args.map((a) => a.paramType).join(',')}],
|
|
179
154
|
${typeParamArg.length > 0 ? `typeArguments: [${typeParamArg}]` : ``} ) {
|
|
180
155
|
const tx = new TransactionBlock()
|
|
181
|
-
builder.${camel(normalizeToJSName(func.name))}(tx, args ${
|
|
182
|
-
typeParamArg.length > 0 ? `, typeArguments` : ''
|
|
183
|
-
})
|
|
156
|
+
builder.${camel(normalizeToJSName(func.name))}(tx, args ${typeParamArg.length > 0 ? `, typeArguments` : ''})
|
|
184
157
|
const res = await provider.devInspectTransactionBlock({
|
|
185
158
|
transactionBlock: tx,
|
|
186
159
|
sender: ZERO_ADDRESS
|
|
@@ -189,10 +162,7 @@ class SuiCodegen extends AbstractCodegen<
|
|
|
189
162
|
}`
|
|
190
163
|
}
|
|
191
164
|
|
|
192
|
-
protected generateBuilderForFunction(
|
|
193
|
-
module: InternalMoveModule,
|
|
194
|
-
func: InternalMoveFunction
|
|
195
|
-
): string {
|
|
165
|
+
protected generateBuilderForFunction(module: InternalMoveModule, func: InternalMoveFunction): string {
|
|
196
166
|
if (func.visibility !== InternalMoveFunctionVisibility.PUBLIC) {
|
|
197
167
|
return ''
|
|
198
168
|
}
|
|
@@ -212,14 +182,10 @@ class SuiCodegen extends AbstractCodegen<
|
|
|
212
182
|
})
|
|
213
183
|
.join(',')
|
|
214
184
|
|
|
215
|
-
return `export function ${camel(
|
|
216
|
-
normalizeToJSName(func.name)
|
|
217
|
-
)}${genericString}(tx: TransactionBlock,
|
|
185
|
+
return `export function ${camel(normalizeToJSName(func.name))}${genericString}(tx: TransactionBlock,
|
|
218
186
|
args: [${args.map((a) => a.paramType).join(',')}],
|
|
219
187
|
${typeParamArg.length > 0 ? `typeArguments: [${typeParamArg}]` : ``} ):
|
|
220
|
-
TransactionArgument & [ ${'TransactionArgument,'.repeat(
|
|
221
|
-
func.params.length
|
|
222
|
-
)} ] {
|
|
188
|
+
TransactionArgument & [ ${'TransactionArgument,'.repeat(func.params.length)} ] {
|
|
223
189
|
const _args: any[] = []
|
|
224
190
|
${args.map((a) => a.callValue).join('\n')}
|
|
225
191
|
|
|
@@ -227,9 +193,7 @@ class SuiCodegen extends AbstractCodegen<
|
|
|
227
193
|
return tx.moveCall({
|
|
228
194
|
target: "${module.address}::${module.name}::${func.name}",
|
|
229
195
|
arguments: _args,
|
|
230
|
-
${
|
|
231
|
-
typeParamArg.length > 0 ? `typeArguments: [${typeParamToString}]` : ``
|
|
232
|
-
}
|
|
196
|
+
${typeParamArg.length > 0 ? `typeArguments: [${typeParamToString}]` : ``}
|
|
233
197
|
})
|
|
234
198
|
}`
|
|
235
199
|
}
|
package/src/index.ts
CHANGED
package/dist/module-client.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { JsonRpcProvider } from '@mysten/sui.js';
|
|
2
|
-
export declare class ModuleClient {
|
|
3
|
-
viewDecoded(func: string, typeArguments: string[], args: any[], ledger_version?: bigint): Promise<void>;
|
|
4
|
-
}
|
|
5
|
-
export declare class TypedJsonRpcProvider extends JsonRpcProvider {
|
|
6
|
-
xxx(): void;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=module-client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module-client.d.ts","sourceRoot":"","sources":["../src/module-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAEhD,qBAAa,YAAY;IACV,WAAW,CACtB,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,MAAM,EAAE,EACvB,IAAI,EAAE,GAAG,EAAE,EACX,cAAc,CAAC,EAAE,MAAM;CAI1B;AAOD,qBAAa,oBAAqB,SAAQ,eAAe;IAChD,GAAG;CAGX"}
|
package/dist/module-client.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { JsonRpcProvider } from '@mysten/sui.js';
|
|
2
|
-
export class ModuleClient {
|
|
3
|
-
async viewDecoded(func, typeArguments, args, ledger_version) {
|
|
4
|
-
throw Error('not implemented');
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
// const provider: JsonRpcProvider
|
|
8
|
-
//
|
|
9
|
-
// provider.
|
|
10
|
-
export class TypedJsonRpcProvider extends JsonRpcProvider {
|
|
11
|
-
xxx() {
|
|
12
|
-
this.connection.fullnode;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=module-client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module-client.js","sourceRoot":"","sources":["../src/module-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAEhD,MAAM,OAAO,YAAY;IAChB,KAAK,CAAC,WAAW,CACtB,IAAY,EACZ,aAAuB,EACvB,IAAW,EACX,cAAuB;QAEvB,MAAM,KAAK,CAAC,iBAAiB,CAAC,CAAA;IAChC,CAAC;CACF;AAED,kCAAkC;AAElC,EAAE;AACF,YAAY;AAEZ,MAAM,OAAO,oBAAqB,SAAQ,eAAe;IAChD,GAAG;QACR,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAA;IAC1B,CAAC;CACF"}
|
package/src/module-client.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { JsonRpcProvider } from '@mysten/sui.js'
|
|
2
|
-
|
|
3
|
-
export class ModuleClient {
|
|
4
|
-
public async viewDecoded(
|
|
5
|
-
func: string,
|
|
6
|
-
typeArguments: string[],
|
|
7
|
-
args: any[],
|
|
8
|
-
ledger_version?: bigint
|
|
9
|
-
) {
|
|
10
|
-
throw Error('not implemented')
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// const provider: JsonRpcProvider
|
|
15
|
-
|
|
16
|
-
//
|
|
17
|
-
// provider.
|
|
18
|
-
|
|
19
|
-
export class TypedJsonRpcProvider extends JsonRpcProvider {
|
|
20
|
-
public xxx() {
|
|
21
|
-
this.connection.fullnode
|
|
22
|
-
}
|
|
23
|
-
}
|