@typemove/sui 1.5.1 → 1.5.2-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.
- package/Readme.md +8 -4
- package/dist/cjs/builtin/0x1.d.ts +2 -0
- package/dist/cjs/builtin/0x1.d.ts.map +1 -1
- package/dist/cjs/builtin/0x1.js +187 -167
- package/dist/cjs/builtin/0x1.js.map +1 -1
- package/dist/cjs/builtin/0x2.d.ts +121 -0
- package/dist/cjs/builtin/0x2.d.ts.map +1 -1
- package/dist/cjs/builtin/0x2.js +1077 -856
- package/dist/cjs/builtin/0x2.js.map +1 -1
- package/dist/cjs/builtin/0x3.js +212 -212
- package/dist/cjs/codegen/codegen.js +2 -2
- package/dist/cjs/move-coder.d.ts +1 -1
- package/dist/cjs/move-coder.js +4 -4
- package/dist/esm/builtin/0x1.d.ts +2 -0
- package/dist/esm/builtin/0x1.d.ts.map +1 -1
- package/dist/esm/builtin/0x1.js +187 -167
- package/dist/esm/builtin/0x1.js.map +1 -1
- package/dist/esm/builtin/0x2.d.ts +121 -0
- package/dist/esm/builtin/0x2.d.ts.map +1 -1
- package/dist/esm/builtin/0x2.js +1076 -855
- package/dist/esm/builtin/0x2.js.map +1 -1
- package/dist/esm/builtin/0x3.js +212 -212
- package/dist/esm/codegen/codegen.js +2 -2
- package/dist/esm/move-coder.d.ts +1 -1
- package/dist/esm/move-coder.js +4 -4
- package/package.json +2 -2
- package/src/abis/0x1.json +20 -0
- package/src/abis/0x2.json +551 -0
- package/src/builtin/0x1.ts +195 -167
- package/src/builtin/0x2.ts +1238 -855
- package/src/builtin/0x3.ts +212 -212
- package/src/codegen/codegen.ts +2 -2
- package/src/move-coder.ts +4 -4
- package/src/tests/types/testnet/0x1e2b124f746a339b3cf99b9f969393a96594519aafb1d06517aacfeeae20e7a5.ts +8 -8
- package/src/tests/types/testnet/0x6c4a21e3e7e6b6d51c4604021633e1d97e24e37a696f8c082cd48f37503e602a.ts +96 -96
- package/src/tests/types/testnet/0xdee9.ts +94 -94
- package/src/tests/types/testnet/0xebaa2ad3eacc230f309cd933958cc52684df0a41ae7ac214d186b80f830867d2.ts +310 -310
package/src/codegen/codegen.ts
CHANGED
|
@@ -165,12 +165,12 @@ export class SuiCodegen extends AbstractCodegen<
|
|
|
165
165
|
} ): Promise<TypedDevInspectResults<${returnType}>> {
|
|
166
166
|
const tx = new TransactionBlock()
|
|
167
167
|
builder.${camel(normalizeToJSName(func.name))}(tx, args ${typeParamArg.length > 0 ? `, typeArguments` : ''})
|
|
168
|
-
const
|
|
168
|
+
const inspectRes = await client.devInspectTransactionBlock({
|
|
169
169
|
transactionBlock: tx,
|
|
170
170
|
sender: ZERO_ADDRESS
|
|
171
171
|
})
|
|
172
172
|
|
|
173
|
-
return (await getMoveCoder(client)).decodeDevInspectResult<${returnType}>(
|
|
173
|
+
return (await getMoveCoder(client)).decodeDevInspectResult<${returnType}>(inspectRes)
|
|
174
174
|
}`
|
|
175
175
|
}
|
|
176
176
|
|
package/src/move-coder.ts
CHANGED
|
@@ -221,10 +221,10 @@ export class MoveCoder extends AbstractMoveCoder<
|
|
|
221
221
|
return this.bcs.de(type.getNormalizedSignature(), data, encoding)
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
-
async decodeDevInspectResult<T extends any[]>(
|
|
224
|
+
async decodeDevInspectResult<T extends any[]>(inspectRes: DevInspectResults): Promise<TypedDevInspectResults<T>> {
|
|
225
225
|
const returnValues = []
|
|
226
|
-
if (
|
|
227
|
-
for (const r of
|
|
226
|
+
if (inspectRes.results != null) {
|
|
227
|
+
for (const r of inspectRes.results) {
|
|
228
228
|
if (r.returnValues) {
|
|
229
229
|
const type = parseMoveType(r.returnValues[0][1])
|
|
230
230
|
const value = r.returnValues[0][0]
|
|
@@ -236,7 +236,7 @@ export class MoveCoder extends AbstractMoveCoder<
|
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
|
-
return { ...
|
|
239
|
+
return { ...inspectRes, results_decoded: returnValues as any }
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
242
|
|
|
@@ -218,13 +218,13 @@ export namespace oracle {
|
|
|
218
218
|
): Promise<TypedDevInspectResults<[]>> {
|
|
219
219
|
const tx = new TransactionBlock();
|
|
220
220
|
builder.copyKey(tx, args, typeArguments);
|
|
221
|
-
const
|
|
221
|
+
const inspectRes = await client.devInspectTransactionBlock({
|
|
222
222
|
transactionBlock: tx,
|
|
223
223
|
sender: ZERO_ADDRESS,
|
|
224
224
|
});
|
|
225
225
|
|
|
226
226
|
return (await getMoveCoder(client)).decodeDevInspectResult<[]>(
|
|
227
|
-
|
|
227
|
+
inspectRes,
|
|
228
228
|
);
|
|
229
229
|
}
|
|
230
230
|
export async function getOracle<T0 = any>(
|
|
@@ -234,14 +234,14 @@ export namespace oracle {
|
|
|
234
234
|
): Promise<TypedDevInspectResults<[bigint, bigint, bigint, bigint]>> {
|
|
235
235
|
const tx = new TransactionBlock();
|
|
236
236
|
builder.getOracle(tx, args, typeArguments);
|
|
237
|
-
const
|
|
237
|
+
const inspectRes = await client.devInspectTransactionBlock({
|
|
238
238
|
transactionBlock: tx,
|
|
239
239
|
sender: ZERO_ADDRESS,
|
|
240
240
|
});
|
|
241
241
|
|
|
242
242
|
return (await getMoveCoder(client)).decodeDevInspectResult<
|
|
243
243
|
[bigint, bigint, bigint, bigint]
|
|
244
|
-
>(
|
|
244
|
+
>(inspectRes);
|
|
245
245
|
}
|
|
246
246
|
export async function newOracle<T0 = any>(
|
|
247
247
|
client: SuiClient,
|
|
@@ -253,13 +253,13 @@ export namespace oracle {
|
|
|
253
253
|
): Promise<TypedDevInspectResults<[]>> {
|
|
254
254
|
const tx = new TransactionBlock();
|
|
255
255
|
builder.newOracle(tx, args, typeArguments);
|
|
256
|
-
const
|
|
256
|
+
const inspectRes = await client.devInspectTransactionBlock({
|
|
257
257
|
transactionBlock: tx,
|
|
258
258
|
sender: ZERO_ADDRESS,
|
|
259
259
|
});
|
|
260
260
|
|
|
261
261
|
return (await getMoveCoder(client)).decodeDevInspectResult<[]>(
|
|
262
|
-
|
|
262
|
+
inspectRes,
|
|
263
263
|
);
|
|
264
264
|
}
|
|
265
265
|
export async function update<T0 = any>(
|
|
@@ -276,13 +276,13 @@ export namespace oracle {
|
|
|
276
276
|
): Promise<TypedDevInspectResults<[]>> {
|
|
277
277
|
const tx = new TransactionBlock();
|
|
278
278
|
builder.update(tx, args, typeArguments);
|
|
279
|
-
const
|
|
279
|
+
const inspectRes = await client.devInspectTransactionBlock({
|
|
280
280
|
transactionBlock: tx,
|
|
281
281
|
sender: ZERO_ADDRESS,
|
|
282
282
|
});
|
|
283
283
|
|
|
284
284
|
return (await getMoveCoder(client)).decodeDevInspectResult<[]>(
|
|
285
|
-
|
|
285
|
+
inspectRes,
|
|
286
286
|
);
|
|
287
287
|
}
|
|
288
288
|
}
|