@layerzerolabs/common-suimove 0.0.73
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/.turbo/turbo-build.log +64 -0
- package/.turbo/turbo-lint.log +4 -0
- package/.turbo/turbo-test.log +16 -0
- package/dist/7LWJNWY6.cjs +4 -0
- package/dist/7LWJNWY6.cjs.map +1 -0
- package/dist/AHFVRB2R.cjs +27 -0
- package/dist/AHFVRB2R.cjs.map +1 -0
- package/dist/CHPRFEFD.js +69 -0
- package/dist/CHPRFEFD.js.map +1 -0
- package/dist/DMFKLZKD.js +3 -0
- package/dist/DMFKLZKD.js.map +1 -0
- package/dist/EAFPTVEK.cjs +74 -0
- package/dist/EAFPTVEK.cjs.map +1 -0
- package/dist/L6EI37IO.cjs +4 -0
- package/dist/L6EI37IO.cjs.map +1 -0
- package/dist/OQ5C7BFY.js +23 -0
- package/dist/OQ5C7BFY.js.map +1 -0
- package/dist/PKPG4OQE.cjs +4 -0
- package/dist/PKPG4OQE.cjs.map +1 -0
- package/dist/QRJFMNTB.js +3 -0
- package/dist/QRJFMNTB.js.map +1 -0
- package/dist/Y5EOMP5J.js +3 -0
- package/dist/Y5EOMP5J.js.map +1 -0
- package/dist/error.cjs +16 -0
- package/dist/error.cjs.map +1 -0
- package/dist/error.d.ts +7 -0
- package/dist/error.d.ts.map +1 -0
- package/dist/error.js +3 -0
- package/dist/error.js.map +1 -0
- package/dist/index.cjs +28 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/provider.cjs +6 -0
- package/dist/provider.cjs.map +1 -0
- package/dist/provider.d.ts +36 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +3 -0
- package/dist/provider.js.map +1 -0
- package/dist/transaction.cjs +6 -0
- package/dist/transaction.cjs.map +1 -0
- package/dist/transaction.d.ts +73 -0
- package/dist/transaction.d.ts.map +1 -0
- package/dist/transaction.js +3 -0
- package/dist/transaction.js.map +1 -0
- package/dist/types.cjs +6 -0
- package/dist/types.cjs.map +1 -0
- package/dist/types.d.ts +63 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.cjs +25 -0
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.ts +11 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +4 -0
- package/dist/utils.js.map +1 -0
- package/package.json +36 -0
- package/src/error.ts +9 -0
- package/src/index.ts +4 -0
- package/src/provider.ts +45 -0
- package/src/transaction.ts +83 -0
- package/src/types.ts +109 -0
- package/src/utils.ts +86 -0
- package/tsconfig.json +20 -0
- package/tsup.config.ts +8 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
|
|
2
|
+
> @layerzerolabs/common-suimove@0.0.0 build /home/runner/work/monorepo-internal/monorepo-internal/packages/vms/common-suimove
|
|
3
|
+
> tsup
|
|
4
|
+
|
|
5
|
+
[34mCLI[39m Building entry: src/error.ts, src/index.ts, src/provider.ts, src/transaction.ts, src/types.ts, src/utils.ts
|
|
6
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
+
[34mCLI[39m tsup v8.4.0
|
|
8
|
+
[34mCLI[39m Using tsup config: /home/runner/work/monorepo-internal/monorepo-internal/packages/vms/common-suimove/tsup.config.ts
|
|
9
|
+
[34mCLI[39m Target: ES2023
|
|
10
|
+
[34mCLI[39m Cleaning output folder
|
|
11
|
+
[34mCJS[39m Build start
|
|
12
|
+
[34mESM[39m Build start
|
|
13
|
+
Generated an empty chunk: "L6EI37IO".
|
|
14
|
+
Generated an empty chunk: "7LWJNWY6".
|
|
15
|
+
Generated an empty chunk: "PKPG4OQE".
|
|
16
|
+
Generated an empty chunk: "QRJFMNTB".
|
|
17
|
+
Generated an empty chunk: "DMFKLZKD".
|
|
18
|
+
Generated an empty chunk: "Y5EOMP5J".
|
|
19
|
+
[32mCJS[39m [1mdist/error.cjs [22m[32m427.00 B[39m
|
|
20
|
+
[32mCJS[39m [1mdist/provider.cjs [22m[32m118.00 B[39m
|
|
21
|
+
[32mCJS[39m [1mdist/L6EI37IO.cjs [22m[32m90.00 B[39m
|
|
22
|
+
[32mCJS[39m [1mdist/transaction.cjs [22m[32m124.00 B[39m
|
|
23
|
+
[32mCJS[39m [1mdist/types.cjs [22m[32m112.00 B[39m
|
|
24
|
+
[32mCJS[39m [1mdist/7LWJNWY6.cjs [22m[32m90.00 B[39m
|
|
25
|
+
[32mCJS[39m [1mdist/PKPG4OQE.cjs [22m[32m90.00 B[39m
|
|
26
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m797.00 B[39m
|
|
27
|
+
[32mCJS[39m [1mdist/utils.cjs [22m[32m716.00 B[39m
|
|
28
|
+
[32mCJS[39m [1mdist/EAFPTVEK.cjs [22m[32m2.46 KB[39m
|
|
29
|
+
[32mCJS[39m [1mdist/AHFVRB2R.cjs [22m[32m753.00 B[39m
|
|
30
|
+
[32mCJS[39m [1mdist/error.cjs.map [22m[32m70.00 B[39m
|
|
31
|
+
[32mCJS[39m [1mdist/provider.cjs.map [22m[32m73.00 B[39m
|
|
32
|
+
[32mCJS[39m [1mdist/L6EI37IO.cjs.map [22m[32m73.00 B[39m
|
|
33
|
+
[32mCJS[39m [1mdist/transaction.cjs.map [22m[32m76.00 B[39m
|
|
34
|
+
[32mCJS[39m [1mdist/types.cjs.map [22m[32m70.00 B[39m
|
|
35
|
+
[32mCJS[39m [1mdist/7LWJNWY6.cjs.map [22m[32m73.00 B[39m
|
|
36
|
+
[32mCJS[39m [1mdist/index.cjs.map [22m[32m70.00 B[39m
|
|
37
|
+
[32mCJS[39m [1mdist/utils.cjs.map [22m[32m70.00 B[39m
|
|
38
|
+
[32mCJS[39m [1mdist/EAFPTVEK.cjs.map [22m[32m5.83 KB[39m
|
|
39
|
+
[32mCJS[39m [1mdist/AHFVRB2R.cjs.map [22m[32m823.00 B[39m
|
|
40
|
+
[32mCJS[39m [1mdist/PKPG4OQE.cjs.map [22m[32m73.00 B[39m
|
|
41
|
+
[32mCJS[39m ⚡️ Build success in 217ms
|
|
42
|
+
[32mESM[39m [1mdist/error.js [22m[32m144.00 B[39m
|
|
43
|
+
[32mESM[39m [1mdist/provider.js [22m[32m97.00 B[39m
|
|
44
|
+
[32mESM[39m [1mdist/index.js [22m[32m269.00 B[39m
|
|
45
|
+
[32mESM[39m [1mdist/QRJFMNTB.js [22m[32m74.00 B[39m
|
|
46
|
+
[32mESM[39m [1mdist/DMFKLZKD.js [22m[32m74.00 B[39m
|
|
47
|
+
[32mESM[39m [1mdist/transaction.js [22m[32m103.00 B[39m
|
|
48
|
+
[32mESM[39m [1mdist/types.js [22m[32m91.00 B[39m
|
|
49
|
+
[32mESM[39m [1mdist/Y5EOMP5J.js [22m[32m74.00 B[39m
|
|
50
|
+
[32mESM[39m [1mdist/CHPRFEFD.js [22m[32m2.29 KB[39m
|
|
51
|
+
[32mESM[39m [1mdist/OQ5C7BFY.js [22m[32m667.00 B[39m
|
|
52
|
+
[32mESM[39m [1mdist/utils.js [22m[32m197.00 B[39m
|
|
53
|
+
[32mESM[39m [1mdist/error.js.map [22m[32m69.00 B[39m
|
|
54
|
+
[32mESM[39m [1mdist/provider.js.map [22m[32m72.00 B[39m
|
|
55
|
+
[32mESM[39m [1mdist/index.js.map [22m[32m69.00 B[39m
|
|
56
|
+
[32mESM[39m [1mdist/QRJFMNTB.js.map [22m[32m72.00 B[39m
|
|
57
|
+
[32mESM[39m [1mdist/DMFKLZKD.js.map [22m[32m72.00 B[39m
|
|
58
|
+
[32mESM[39m [1mdist/transaction.js.map [22m[32m75.00 B[39m
|
|
59
|
+
[32mESM[39m [1mdist/types.js.map [22m[32m69.00 B[39m
|
|
60
|
+
[32mESM[39m [1mdist/Y5EOMP5J.js.map [22m[32m72.00 B[39m
|
|
61
|
+
[32mESM[39m [1mdist/CHPRFEFD.js.map [22m[32m5.82 KB[39m
|
|
62
|
+
[32mESM[39m [1mdist/OQ5C7BFY.js.map [22m[32m820.00 B[39m
|
|
63
|
+
[32mESM[39m [1mdist/utils.js.map [22m[32m69.00 B[39m
|
|
64
|
+
[32mESM[39m ⚡️ Build success in 217ms
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
> @layerzerolabs/common-suimove@0.0.0 test /home/runner/work/monorepo-internal/monorepo-internal/packages/vms/common-suimove
|
|
3
|
+
> vitest --run --pass-with-no-tests --typecheck
|
|
4
|
+
|
|
5
|
+
[33mTesting types with tsc and vue-tsc is an experimental feature.
|
|
6
|
+
Breaking changes might not follow SemVer, please pin Vitest's version when using it.[39m
|
|
7
|
+
|
|
8
|
+
[1m[46m RUN [49m[22m [36mv3.2.3 [39m[90m/home/runner/work/monorepo-internal/monorepo-internal/packages/vms/common-suimove[39m
|
|
9
|
+
|
|
10
|
+
No test files found, exiting with code 0
|
|
11
|
+
|
|
12
|
+
[2minclude: [22m[33m**/*.{test,spec}.?(c|m)[jt]s?(x)[39m
|
|
13
|
+
[2mexclude: [22m[33m**/node_modules/**[2m, [22m**/dist/**[2m, [22m**/cypress/**[2m, [22m**/.{idea,git,cache,output,temp}/**[2m, [22m**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*[39m
|
|
14
|
+
[2mtypecheck include: [22m[33m**/*.{test,spec}-d.?(c|m)[jt]s?(x)[39m
|
|
15
|
+
[2mtypecheck exclude: [22m[33m**/node_modules/**[2m, [22m**/dist/**[2m, [22m**/cypress/**[2m, [22m**/.{idea,git,cache,output,temp}/**[2m, [22m**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*[39m
|
|
16
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"7LWJNWY6.cjs"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
+
|
|
6
|
+
// src/error.ts
|
|
7
|
+
var SuiMoveAbortError = class extends Error {
|
|
8
|
+
static {
|
|
9
|
+
__name(this, "SuiMoveAbortError");
|
|
10
|
+
}
|
|
11
|
+
abortCode;
|
|
12
|
+
constructor(abortCode, rawMsg) {
|
|
13
|
+
super(`Move abort with code: ${abortCode}. Raw error message: ${rawMsg}`);
|
|
14
|
+
this.abortCode = abortCode;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var SuiMoveUnclassifiedError = class extends Error {
|
|
18
|
+
static {
|
|
19
|
+
__name(this, "SuiMoveUnclassifiedError");
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
exports.SuiMoveAbortError = SuiMoveAbortError;
|
|
24
|
+
exports.SuiMoveUnclassifiedError = SuiMoveUnclassifiedError;
|
|
25
|
+
exports.__name = __name;
|
|
26
|
+
//# sourceMappingURL=AHFVRB2R.cjs.map
|
|
27
|
+
//# sourceMappingURL=AHFVRB2R.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/error.ts"],"names":["SuiMoveAbortError","Error","abortCode","rawMsg","SuiMoveUnclassifiedError"],"mappings":";;;;;;AAAO,IAAMA,iBAAAA,GAAN,cAAgCC,KAAAA,CAAAA;EAAvC;;;AACaC,EAAAA,SAAAA;AACT,EAAA,WAAA,CAAYA,WAAmBC,MAAAA,EAAgB;AAC3C,IAAA,KAAA,CAAM,CAAA,sBAAA,EAAyBD,SAAAA,CAAAA,qBAAAA,EAAiCC,MAAAA,CAAAA,CAAQ,CAAA;AACxE,IAAA,IAAA,CAAKD,SAAAA,GAAYA,SAAAA;AACrB,EAAA;AACJ;AAEO,IAAME,wBAAAA,GAAN,cAAuCH,KAAAA,CAAAA;EAR9C;;;AAQqD","file":"AHFVRB2R.cjs","sourcesContent":["export class SuiMoveAbortError extends Error {\n readonly abortCode: number;\n constructor(abortCode: number, rawMsg: string) {\n super(`Move abort with code: ${abortCode}. Raw error message: ${rawMsg}`);\n this.abortCode = abortCode;\n }\n}\n\nexport class SuiMoveUnclassifiedError extends Error {}\n"]}
|
package/dist/CHPRFEFD.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { __name, SuiMoveAbortError, SuiMoveUnclassifiedError } from './OQ5C7BFY.js';
|
|
2
|
+
import { fromBase64 } from '@mysten/sui/utils';
|
|
3
|
+
|
|
4
|
+
var MOCK_SENDER = "0x1234567890123456789012345678901234567890123456789012345678901234";
|
|
5
|
+
var convertToSuiMoveEvents = /* @__PURE__ */ __name((rawEvents) => {
|
|
6
|
+
return rawEvents.map((event) => ({
|
|
7
|
+
type: event.type,
|
|
8
|
+
data: event.parsedJson,
|
|
9
|
+
txHash: event.id.txDigest
|
|
10
|
+
}));
|
|
11
|
+
}, "convertToSuiMoveEvents");
|
|
12
|
+
function handleError(e) {
|
|
13
|
+
if (e.includes("ExecutionError")) {
|
|
14
|
+
const majorStatusMatch = e.match(/major_status:\s([A-Z_]+)/);
|
|
15
|
+
if (majorStatusMatch !== null) {
|
|
16
|
+
const major_status = majorStatusMatch[1];
|
|
17
|
+
if (major_status === "ABORTED") {
|
|
18
|
+
const subStatusMatch = e.match(/sub_status:\sSome\((\d+)\)/);
|
|
19
|
+
if (subStatusMatch === null) {
|
|
20
|
+
return new SuiMoveAbortError(Number.NEGATIVE_INFINITY, e);
|
|
21
|
+
} else {
|
|
22
|
+
return new SuiMoveAbortError(Number(subStatusMatch[1]), e);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
} else {
|
|
26
|
+
return new SuiMoveUnclassifiedError(e);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return new Error(e);
|
|
30
|
+
}
|
|
31
|
+
__name(handleError, "handleError");
|
|
32
|
+
async function suiMoveViewMultiResult(client, tx, resultIndex) {
|
|
33
|
+
const { results, error } = await client.devInspectSuiMoveTransactionBlock({
|
|
34
|
+
transactionBlock: tx,
|
|
35
|
+
sender: MOCK_SENDER
|
|
36
|
+
});
|
|
37
|
+
if (error != void 0 && error != null) {
|
|
38
|
+
throw handleError(error);
|
|
39
|
+
}
|
|
40
|
+
if (results === void 0 || results === null) {
|
|
41
|
+
throw new Error("No results found");
|
|
42
|
+
}
|
|
43
|
+
const selectedResults = resultIndex.map((idx) => {
|
|
44
|
+
return results[idx];
|
|
45
|
+
});
|
|
46
|
+
return selectedResults.map((result) => {
|
|
47
|
+
if (result.returnValues === void 0) {
|
|
48
|
+
throw new Error("No return values found");
|
|
49
|
+
}
|
|
50
|
+
return result.returnValues.map((result2) => {
|
|
51
|
+
return {
|
|
52
|
+
value: typeof result2[0] === "string" ? fromBase64(result2[0]) : new Uint8Array(result2[0]),
|
|
53
|
+
type: result2[1]
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
__name(suiMoveViewMultiResult, "suiMoveViewMultiResult");
|
|
59
|
+
async function suiMoveView(suiClient, tx) {
|
|
60
|
+
const results = await suiMoveViewMultiResult(suiClient, tx, [
|
|
61
|
+
tx.getData().commands.length - 1
|
|
62
|
+
]);
|
|
63
|
+
return results[0];
|
|
64
|
+
}
|
|
65
|
+
__name(suiMoveView, "suiMoveView");
|
|
66
|
+
|
|
67
|
+
export { convertToSuiMoveEvents, handleError, suiMoveView, suiMoveViewMultiResult };
|
|
68
|
+
//# sourceMappingURL=CHPRFEFD.js.map
|
|
69
|
+
//# sourceMappingURL=CHPRFEFD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils.ts"],"names":["MOCK_SENDER","convertToSuiMoveEvents","rawEvents","map","event","type","data","parsedJson","txHash","id","txDigest","handleError","e","includes","majorStatusMatch","match","major_status","subStatusMatch","SuiMoveAbortError","Number","NEGATIVE_INFINITY","SuiMoveUnclassifiedError","Error","suiMoveViewMultiResult","client","tx","resultIndex","results","error","devInspectSuiMoveTransactionBlock","transactionBlock","sender","undefined","selectedResults","idx","result","returnValues","value","fromBase64","Uint8Array","suiMoveView","suiClient","getData","commands","length"],"mappings":";;;AAOA,IAAMA,WAAAA,GAAc,oEAAA;AAKb,IAAMC,sBAAAA,2BAA0BC,SAAAA,KAAAA;AACnC,EAAA,OAAOA,SAAAA,CAAUC,GAAAA,CAAI,CAACC,KAAAA,MAAW;AAC7BC,IAAAA,IAAAA,EAAMD,KAAAA,CAAMC,IAAAA;AACZC,IAAAA,IAAAA,EAAMF,KAAAA,CAAMG,UAAAA;AACZC,IAAAA,MAAAA,EAAQJ,MAAMK,EAAAA,CAAGC;GACrB,CAAA,CAAA;AACJ,CAAA,EANsC,wBAAA;AAQ/B,SAASC,YAAYC,CAAAA,EAAS;AACjC,EAAA,IAAIA,CAAAA,CAAEC,QAAAA,CAAS,gBAAA,CAAA,EAAmB;AAC9B,IAAA,MAAMC,gBAAAA,GAAmBF,CAAAA,CAAEG,KAAAA,CAAM,0BAAA,CAAA;AACjC,IAAA,IAAID,qBAAqB,IAAA,EAAM;AAC3B,MAAA,MAAME,YAAAA,GAAeF,iBAAiB,CAAA,CAAA;AACtC,MAAA,IAAIE,iBAAiB,SAAA,EAAW;AAC5B,QAAA,MAAMC,cAAAA,GAAiBL,CAAAA,CAAEG,KAAAA,CAAM,4BAAA,CAAA;AAC/B,QAAA,IAAIE,mBAAmB,IAAA,EAAM;AACzB,UAAA,OAAO,IAAIC,iBAAAA,CAAkBC,MAAAA,CAAOC,iBAAAA,EAAmBR,CAAAA,CAAAA;QAC3D,CAAA,MAAO;AACH,UAAA,OAAO,IAAIM,iBAAAA,CAAkBC,MAAAA,CAAOF,eAAe,CAAA,CAAE,GAAGL,CAAAA,CAAAA;AAC5D,QAAA;AACJ,MAAA;IACJ,CAAA,MAAO;AACH,MAAA,OAAO,IAAIS,yBAAyBT,CAAAA,CAAAA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B,QAAAA,IAAAA,EAAM8B,QAAO,CAAA;AACjB,OAAA;IACJ,CAAA,CAAA;EACJ,CAAA,CAAA;AACJ;AAnCsBZ,MAAAA,CAAAA,sBAAAA,EAAAA,wBAAAA,CAAAA;AAqCtB,eAAsBiB,WAAAA,CAClBC,WACAhB,EAAAA,EAAsB;AAEtB,EAAA,MAAME,OAAAA,GAAU,MAAMJ,sBAAAA,CAAuBkB,SAAAA,EAAWhB,EAAAA,EAAI;IACxDA,EAAAA,CAAGiB,OAAAA,EAAO,CAAGC,QAAAA,CAASC,MAAAA,GAAS;AAClC,GAAA,CAAA;AACD,EAAA,OAAOjB,QAAQ,CAAA,CAAA;AACnB;AARsBa,MAAAA,CAAAA,WAAAA,EAAAA,aAAAA,CAAAA","file":"CHPRFEFD.js","sourcesContent":["import { fromBase64 } from '@mysten/sui/utils';\n\nimport { SuiMoveAbortError, SuiMoveUnclassifiedError } from './error';\nimport type { SuiMoveProvider } from './provider';\nimport type { SuiMoveTransaction } from './transaction';\nimport type { SuiMoveEvent, SuiMoveExecutionResult, SuiMoveViewResult } from './types';\n\nconst MOCK_SENDER = '0x1234567890123456789012345678901234567890123456789012345678901234';\n\n/**\n * Converts raw Sui move events to SuiMoveEvent format\n */\nexport const convertToSuiMoveEvents = (rawEvents: any[]): SuiMoveEvent[] => {\n return rawEvents.map((event) => ({\n type: event.type,\n data: event.parsedJson,\n txHash: event.id.txDigest,\n }));\n};\n\nexport function handleError(e: string): unknown {\n if (e.includes('ExecutionError')) {\n const majorStatusMatch = e.match(/major_status:\\s([A-Z_]+)/);\n if (majorStatusMatch !== null) {\n const major_status = majorStatusMatch[1];\n if (major_status === 'ABORTED') {\n const subStatusMatch = e.match(/sub_status:\\sSome\\((\\d+)\\)/);\n if (subStatusMatch === null) {\n return new SuiMoveAbortError(Number.NEGATIVE_INFINITY, e);\n } else {\n return new SuiMoveAbortError(Number(subStatusMatch[1]), e);\n }\n }\n } else {\n return new SuiMoveUnclassifiedError(e);\n }\n }\n return new Error(e);\n}\n\nexport async function suiMoveViewMultiResult(\n client: SuiMoveProvider,\n tx: SuiMoveTransaction,\n resultIndex: number[],\n): Promise<SuiMoveViewResult[][]> {\n const { results, error } = await client.devInspectSuiMoveTransactionBlock({\n transactionBlock: tx,\n sender: MOCK_SENDER,\n });\n\n if (error != undefined && error != null) {\n throw handleError(error);\n }\n if (results === undefined || results === null) {\n throw new Error('No results found');\n }\n\n const selectedResults: SuiMoveExecutionResult[] = resultIndex.map((idx) => {\n return results[idx];\n });\n\n return selectedResults.map((result) => {\n if (result.returnValues === undefined) {\n throw new Error('No return values found');\n }\n return result.returnValues.map((result) => {\n return {\n value:\n typeof result[0] === 'string'\n ? fromBase64(result[0])\n : new Uint8Array(result[0]),\n type: result[1],\n };\n });\n });\n}\n\nexport async function suiMoveView(\n suiClient: SuiMoveProvider,\n tx: SuiMoveTransaction,\n): Promise<SuiMoveViewResult[]> {\n const results = await suiMoveViewMultiResult(suiClient, tx, [\n tx.getData().commands.length - 1, // last command\n ]);\n return results[0];\n}\n"]}
|
package/dist/DMFKLZKD.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"DMFKLZKD.js"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var AHFVRB2R_cjs = require('./AHFVRB2R.cjs');
|
|
4
|
+
var utils = require('@mysten/sui/utils');
|
|
5
|
+
|
|
6
|
+
var MOCK_SENDER = "0x1234567890123456789012345678901234567890123456789012345678901234";
|
|
7
|
+
var convertToSuiMoveEvents = /* @__PURE__ */ AHFVRB2R_cjs.__name((rawEvents) => {
|
|
8
|
+
return rawEvents.map((event) => ({
|
|
9
|
+
type: event.type,
|
|
10
|
+
data: event.parsedJson,
|
|
11
|
+
txHash: event.id.txDigest
|
|
12
|
+
}));
|
|
13
|
+
}, "convertToSuiMoveEvents");
|
|
14
|
+
function handleError(e) {
|
|
15
|
+
if (e.includes("ExecutionError")) {
|
|
16
|
+
const majorStatusMatch = e.match(/major_status:\s([A-Z_]+)/);
|
|
17
|
+
if (majorStatusMatch !== null) {
|
|
18
|
+
const major_status = majorStatusMatch[1];
|
|
19
|
+
if (major_status === "ABORTED") {
|
|
20
|
+
const subStatusMatch = e.match(/sub_status:\sSome\((\d+)\)/);
|
|
21
|
+
if (subStatusMatch === null) {
|
|
22
|
+
return new AHFVRB2R_cjs.SuiMoveAbortError(Number.NEGATIVE_INFINITY, e);
|
|
23
|
+
} else {
|
|
24
|
+
return new AHFVRB2R_cjs.SuiMoveAbortError(Number(subStatusMatch[1]), e);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
} else {
|
|
28
|
+
return new AHFVRB2R_cjs.SuiMoveUnclassifiedError(e);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return new Error(e);
|
|
32
|
+
}
|
|
33
|
+
AHFVRB2R_cjs.__name(handleError, "handleError");
|
|
34
|
+
async function suiMoveViewMultiResult(client, tx, resultIndex) {
|
|
35
|
+
const { results, error } = await client.devInspectSuiMoveTransactionBlock({
|
|
36
|
+
transactionBlock: tx,
|
|
37
|
+
sender: MOCK_SENDER
|
|
38
|
+
});
|
|
39
|
+
if (error != void 0 && error != null) {
|
|
40
|
+
throw handleError(error);
|
|
41
|
+
}
|
|
42
|
+
if (results === void 0 || results === null) {
|
|
43
|
+
throw new Error("No results found");
|
|
44
|
+
}
|
|
45
|
+
const selectedResults = resultIndex.map((idx) => {
|
|
46
|
+
return results[idx];
|
|
47
|
+
});
|
|
48
|
+
return selectedResults.map((result) => {
|
|
49
|
+
if (result.returnValues === void 0) {
|
|
50
|
+
throw new Error("No return values found");
|
|
51
|
+
}
|
|
52
|
+
return result.returnValues.map((result2) => {
|
|
53
|
+
return {
|
|
54
|
+
value: typeof result2[0] === "string" ? utils.fromBase64(result2[0]) : new Uint8Array(result2[0]),
|
|
55
|
+
type: result2[1]
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
AHFVRB2R_cjs.__name(suiMoveViewMultiResult, "suiMoveViewMultiResult");
|
|
61
|
+
async function suiMoveView(suiClient, tx) {
|
|
62
|
+
const results = await suiMoveViewMultiResult(suiClient, tx, [
|
|
63
|
+
tx.getData().commands.length - 1
|
|
64
|
+
]);
|
|
65
|
+
return results[0];
|
|
66
|
+
}
|
|
67
|
+
AHFVRB2R_cjs.__name(suiMoveView, "suiMoveView");
|
|
68
|
+
|
|
69
|
+
exports.convertToSuiMoveEvents = convertToSuiMoveEvents;
|
|
70
|
+
exports.handleError = handleError;
|
|
71
|
+
exports.suiMoveView = suiMoveView;
|
|
72
|
+
exports.suiMoveViewMultiResult = suiMoveViewMultiResult;
|
|
73
|
+
//# sourceMappingURL=EAFPTVEK.cjs.map
|
|
74
|
+
//# sourceMappingURL=EAFPTVEK.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils.ts"],"names":["MOCK_SENDER","convertToSuiMoveEvents","rawEvents","map","event","type","data","parsedJson","txHash","id","txDigest","handleError","e","includes","majorStatusMatch","match","major_status","subStatusMatch","SuiMoveAbortError","Number","NEGATIVE_INFINITY","SuiMoveUnclassifiedError","Error","suiMoveViewMultiResult","client","tx","resultIndex","results","error","devInspectSuiMoveTransactionBlock","transactionBlock","sender","undefined","selectedResults","idx","result","returnValues","value","fromBase64","Uint8Array","suiMoveView","suiClient","getData","commands","length"],"mappings":";;;;;AAOA,IAAMA,WAAAA,GAAc,oEAAA;AAKb,IAAMC,sBAAAA,wCAA0BC,SAAAA,KAAAA;AACnC,EAAA,OAAOA,SAAAA,CAAUC,GAAAA,CAAI,CAACC,KAAAA,MAAW;AAC7BC,IAAAA,IAAAA,EAAMD,KAAAA,CAAMC,IAAAA;AACZC,IAAAA,IAAAA,EAAMF,KAAAA,CAAMG,UAAAA;AACZC,IAAAA,MAAAA,EAAQJ,MAAMK,EAAAA,CAAGC;GACrB,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AAAA","file":"EAFPTVEK.cjs","sourcesContent":["import { fromBase64 } from '@mysten/sui/utils';\n\nimport { SuiMoveAbortError, SuiMoveUnclassifiedError } from './error';\nimport type { SuiMoveProvider } from './provider';\nimport type { SuiMoveTransaction } from './transaction';\nimport type { SuiMoveEvent, SuiMoveExecutionResult, SuiMoveViewResult } from './types';\n\nconst MOCK_SENDER = '0x1234567890123456789012345678901234567890123456789012345678901234';\n\n/**\n * Converts raw Sui move events to SuiMoveEvent format\n */\nexport const convertToSuiMoveEvents = (rawEvents: any[]): SuiMoveEvent[] => {\n return rawEvents.map((event) => ({\n type: event.type,\n data: event.parsedJson,\n txHash: event.id.txDigest,\n }));\n};\n\nexport function handleError(e: string): unknown {\n if (e.includes('ExecutionError')) {\n const majorStatusMatch = e.match(/major_status:\\s([A-Z_]+)/);\n if (majorStatusMatch !== null) {\n const major_status = majorStatusMatch[1];\n if (major_status === 'ABORTED') {\n const subStatusMatch = e.match(/sub_status:\\sSome\\((\\d+)\\)/);\n if (subStatusMatch === null) {\n return new SuiMoveAbortError(Number.NEGATIVE_INFINITY, e);\n } else {\n return new SuiMoveAbortError(Number(subStatusMatch[1]), e);\n }\n }\n } else {\n return new SuiMoveUnclassifiedError(e);\n }\n }\n return new Error(e);\n}\n\nexport async function suiMoveViewMultiResult(\n client: SuiMoveProvider,\n tx: SuiMoveTransaction,\n resultIndex: number[],\n): Promise<SuiMoveViewResult[][]> {\n const { results, error } = await client.devInspectSuiMoveTransactionBlock({\n transactionBlock: tx,\n sender: MOCK_SENDER,\n });\n\n if (error != undefined && error != null) {\n throw handleError(error);\n }\n if (results === undefined || results === null) {\n throw new Error('No results found');\n }\n\n const selectedResults: SuiMoveExecutionResult[] = resultIndex.map((idx) => {\n return results[idx];\n });\n\n return selectedResults.map((result) => {\n if (result.returnValues === undefined) {\n throw new Error('No return values found');\n }\n return result.returnValues.map((result) => {\n return {\n value:\n typeof result[0] === 'string'\n ? fromBase64(result[0])\n : new Uint8Array(result[0]),\n type: result[1],\n };\n });\n });\n}\n\nexport async function suiMoveView(\n suiClient: SuiMoveProvider,\n tx: SuiMoveTransaction,\n): Promise<SuiMoveViewResult[]> {\n const results = await suiMoveViewMultiResult(suiClient, tx, [\n tx.getData().commands.length - 1, // last command\n ]);\n return results[0];\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"L6EI37IO.cjs"}
|
package/dist/OQ5C7BFY.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
4
|
+
// src/error.ts
|
|
5
|
+
var SuiMoveAbortError = class extends Error {
|
|
6
|
+
static {
|
|
7
|
+
__name(this, "SuiMoveAbortError");
|
|
8
|
+
}
|
|
9
|
+
abortCode;
|
|
10
|
+
constructor(abortCode, rawMsg) {
|
|
11
|
+
super(`Move abort with code: ${abortCode}. Raw error message: ${rawMsg}`);
|
|
12
|
+
this.abortCode = abortCode;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
var SuiMoveUnclassifiedError = class extends Error {
|
|
16
|
+
static {
|
|
17
|
+
__name(this, "SuiMoveUnclassifiedError");
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { SuiMoveAbortError, SuiMoveUnclassifiedError, __name };
|
|
22
|
+
//# sourceMappingURL=OQ5C7BFY.js.map
|
|
23
|
+
//# sourceMappingURL=OQ5C7BFY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/error.ts"],"names":["SuiMoveAbortError","Error","abortCode","rawMsg","SuiMoveUnclassifiedError"],"mappings":";;;;AAAO,IAAMA,iBAAAA,GAAN,cAAgCC,KAAAA,CAAAA;EAAvC;;;AACaC,EAAAA,SAAAA;AACT,EAAA,WAAA,CAAYA,WAAmBC,MAAAA,EAAgB;AAC3C,IAAA,KAAA,CAAM,CAAA,sBAAA,EAAyBD,SAAAA,CAAAA,qBAAAA,EAAiCC,MAAAA,CAAAA,CAAQ,CAAA;AACxE,IAAA,IAAA,CAAKD,SAAAA,GAAYA,SAAAA;AACrB,EAAA;AACJ;AAEO,IAAME,wBAAAA,GAAN,cAAuCH,KAAAA,CAAAA;EAR9C;;;AAQqD","file":"OQ5C7BFY.js","sourcesContent":["export class SuiMoveAbortError extends Error {\n readonly abortCode: number;\n constructor(abortCode: number, rawMsg: string) {\n super(`Move abort with code: ${abortCode}. Raw error message: ${rawMsg}`);\n this.abortCode = abortCode;\n }\n}\n\nexport class SuiMoveUnclassifiedError extends Error {}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"PKPG4OQE.cjs"}
|
package/dist/QRJFMNTB.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"QRJFMNTB.js"}
|
package/dist/Y5EOMP5J.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"Y5EOMP5J.js"}
|
package/dist/error.cjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var AHFVRB2R_cjs = require('./AHFVRB2R.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "SuiMoveAbortError", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () { return AHFVRB2R_cjs.SuiMoveAbortError; }
|
|
10
|
+
});
|
|
11
|
+
Object.defineProperty(exports, "SuiMoveUnclassifiedError", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () { return AHFVRB2R_cjs.SuiMoveUnclassifiedError; }
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=error.cjs.map
|
|
16
|
+
//# sourceMappingURL=error.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"error.cjs"}
|
package/dist/error.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA,qBAAa,iBAAkB,SAAQ,KAAK;IACxC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;gBACf,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAIhD;AAED,qBAAa,wBAAyB,SAAQ,KAAK;CAAG"}
|
package/dist/error.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"error.js"}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
require('./L6EI37IO.cjs');
|
|
4
|
+
require('./7LWJNWY6.cjs');
|
|
5
|
+
require('./PKPG4OQE.cjs');
|
|
6
|
+
var EAFPTVEK_cjs = require('./EAFPTVEK.cjs');
|
|
7
|
+
require('./AHFVRB2R.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
Object.defineProperty(exports, "convertToSuiMoveEvents", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () { return EAFPTVEK_cjs.convertToSuiMoveEvents; }
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(exports, "handleError", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return EAFPTVEK_cjs.handleError; }
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "suiMoveView", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () { return EAFPTVEK_cjs.suiMoveView; }
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports, "suiMoveViewMultiResult", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function () { return EAFPTVEK_cjs.suiMoveViewMultiResult; }
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=index.cjs.map
|
|
28
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import './QRJFMNTB.js';
|
|
2
|
+
import './DMFKLZKD.js';
|
|
3
|
+
import './Y5EOMP5J.js';
|
|
4
|
+
export { convertToSuiMoveEvents, handleError, suiMoveView, suiMoveViewMultiResult } from './CHPRFEFD.js';
|
|
5
|
+
import './OQ5C7BFY.js';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"provider.cjs"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { SuiMoveTransaction } from './transaction';
|
|
2
|
+
import type { SuiMoveCheckpoint, SuiMoveCoinBalance, SuiMoveDevInspectResult, SuiMoveEvent, SuiMoveEventCursor, SuiMoveTransactionBlockResponse } from './types';
|
|
3
|
+
export interface SuiMoveProvider {
|
|
4
|
+
queryEventsByType(args: {
|
|
5
|
+
type: string;
|
|
6
|
+
limit?: number;
|
|
7
|
+
order?: 'ascending' | 'descending';
|
|
8
|
+
cursor?: SuiMoveEventCursor;
|
|
9
|
+
}): Promise<SuiMoveEvent[]>;
|
|
10
|
+
queryEventByTxHash(args: {
|
|
11
|
+
txHash: string;
|
|
12
|
+
limit?: number;
|
|
13
|
+
order?: 'ascending' | 'descending';
|
|
14
|
+
cursor?: SuiMoveEventCursor;
|
|
15
|
+
}): Promise<SuiMoveEvent[]>;
|
|
16
|
+
getCheckpoint(args: {
|
|
17
|
+
id: string;
|
|
18
|
+
}): Promise<SuiMoveCheckpoint>;
|
|
19
|
+
getSuiMoveTransactionBlock(args: {
|
|
20
|
+
digest: string;
|
|
21
|
+
}): Promise<SuiMoveTransactionBlockResponse>;
|
|
22
|
+
getLatestCheckpointSequenceNumber(): Promise<string>;
|
|
23
|
+
getReferenceGasPrice(): Promise<bigint>;
|
|
24
|
+
executeSuiMoveTransactionBlock(args: {
|
|
25
|
+
transactionBlock: string | Uint8Array;
|
|
26
|
+
signature: string | string[];
|
|
27
|
+
}): Promise<SuiMoveTransactionBlockResponse>;
|
|
28
|
+
getCoinBalance(args: {
|
|
29
|
+
address: string;
|
|
30
|
+
}): Promise<SuiMoveCoinBalance>;
|
|
31
|
+
devInspectSuiMoveTransactionBlock(args: {
|
|
32
|
+
transactionBlock: SuiMoveTransaction;
|
|
33
|
+
sender: string;
|
|
34
|
+
}): Promise<SuiMoveDevInspectResult>;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,KAAK,EACR,iBAAiB,EACjB,kBAAkB,EAClB,uBAAuB,EACvB,YAAY,EACZ,kBAAkB,EAClB,+BAA+B,EAClC,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,eAAe;IAC5B,iBAAiB,CAAC,IAAI,EAAE;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK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
{"version":3,"sources":[],"names":[],"mappings":"","file":"transaction.cjs"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { TransactionArgument as IotaTransactionArgument, TransactionObjectArgument as IotaTransactionObjectArgument, TransactionResult as IotaTransactionResult } from '@iota/iota-sdk/transactions';
|
|
2
|
+
import type { Transaction as IotaTransaction } from '@iota/iota-sdk/transactions';
|
|
3
|
+
import type { TransactionArgument as SuiTransactionArgument, TransactionObjectArgument as SuiTransactionObjectArgument, TransactionResult as SuiTransactionResult } from '@mysten/sui/transactions';
|
|
4
|
+
import type { Transaction as SuiTransaction } from '@mysten/sui/transactions';
|
|
5
|
+
export type SuiMoveObjectArgument = SuiTransactionObjectArgument | IotaTransactionObjectArgument;
|
|
6
|
+
export type SuiMoveArgument = SuiTransactionArgument | IotaTransactionArgument;
|
|
7
|
+
export type SuiMoveTransactionResult = SuiTransactionResult | IotaTransactionResult;
|
|
8
|
+
export type SuiMoveClock = SuiTransaction['object']['clock'] | IotaTransaction['object']['clock'];
|
|
9
|
+
export interface SuiMoveTransaction {
|
|
10
|
+
getNew(): SuiMoveTransaction;
|
|
11
|
+
from(tx: SuiMoveTransaction): SuiMoveTransaction;
|
|
12
|
+
setSender(sender: string): void;
|
|
13
|
+
suiMoveCall(args: {
|
|
14
|
+
target: string;
|
|
15
|
+
arguments: SuiMoveArgument[];
|
|
16
|
+
typeArguments: string[];
|
|
17
|
+
}): SuiMoveTransactionResult;
|
|
18
|
+
suiMovePublish(args: {
|
|
19
|
+
modules: number[][] | string[];
|
|
20
|
+
dependencies: string[];
|
|
21
|
+
}): SuiMoveTransactionResult;
|
|
22
|
+
suiMoveTransferObjects(objects: SuiMoveObjectArgument[], target: string | SuiMoveArgument): SuiMoveTransactionResult;
|
|
23
|
+
suiMakeMoveVec(args: {
|
|
24
|
+
type: string;
|
|
25
|
+
elements: SuiMoveObjectArgument[];
|
|
26
|
+
}): SuiMoveTransactionResult;
|
|
27
|
+
toJSON(): Promise<string>;
|
|
28
|
+
getData(): ReturnType<SuiTransaction['getData'] | IotaTransaction['getData']>;
|
|
29
|
+
suiMoveSplitCoins(args: {
|
|
30
|
+
amounts: SuiMoveArgument[];
|
|
31
|
+
}): SuiMoveTransactionResult;
|
|
32
|
+
asObject(args: {
|
|
33
|
+
objectId: string | SuiMoveArgument;
|
|
34
|
+
}): SuiMoveArgument;
|
|
35
|
+
asAddress(args: {
|
|
36
|
+
address: string | SuiMoveArgument;
|
|
37
|
+
}): SuiMoveArgument;
|
|
38
|
+
asAddressVector(args: {
|
|
39
|
+
addresses: string[] | SuiMoveArgument;
|
|
40
|
+
}): SuiMoveArgument;
|
|
41
|
+
asBytesVector(args: {
|
|
42
|
+
bytes: Uint8Array[] | SuiMoveArgument;
|
|
43
|
+
}): SuiMoveArgument;
|
|
44
|
+
asBytes(args: {
|
|
45
|
+
bytes: Uint8Array | SuiMoveArgument;
|
|
46
|
+
}): SuiMoveArgument;
|
|
47
|
+
asU8(args: {
|
|
48
|
+
value: number | SuiMoveArgument;
|
|
49
|
+
}): SuiMoveArgument;
|
|
50
|
+
asU16(args: {
|
|
51
|
+
value: number | SuiMoveArgument;
|
|
52
|
+
}): SuiMoveArgument;
|
|
53
|
+
asU32(args: {
|
|
54
|
+
value: number | SuiMoveArgument;
|
|
55
|
+
}): SuiMoveArgument;
|
|
56
|
+
asU64(args: {
|
|
57
|
+
value: bigint | number | string | SuiMoveArgument;
|
|
58
|
+
}): SuiMoveArgument;
|
|
59
|
+
asU128(args: {
|
|
60
|
+
value: bigint | number | string | SuiMoveArgument;
|
|
61
|
+
}): SuiMoveArgument;
|
|
62
|
+
asU256(args: {
|
|
63
|
+
value: bigint | number | string | SuiMoveArgument;
|
|
64
|
+
}): SuiMoveArgument;
|
|
65
|
+
asString(args: {
|
|
66
|
+
value: string | SuiMoveArgument;
|
|
67
|
+
}): SuiMoveArgument;
|
|
68
|
+
asBool(args: {
|
|
69
|
+
value: boolean | SuiMoveArgument;
|
|
70
|
+
}): SuiMoveArgument;
|
|
71
|
+
getClock(): ReturnType<SuiMoveClock>;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=transaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../src/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,mBAAmB,IAAI,uBAAuB,EAC9C,yBAAyB,IAAI,6BAA6B,EAC1D,iBAAiB,IAAI,qBAAqB,EAC7C,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAClF,OAAO,KAAK,EACR,mBAAmB,IAAI,sBAAsB,EAC7C,yBAAyB,IAAI,4BAA4B,EACzD,iBAAiB,IAAI,oBAAoB,EAC5C,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,WAAW,IAAI,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE9E,MAAM,MAAM,qBAAqB,GAAG,4BAA4B,GAAG,6BAA6B,CAAC;AAEjG,MAAM,MAAM,eAAe,GAAG,sBAAsB,GAAG,uBAAuB,CAAC;AAE/E,MAAM,MAAM,wBAAwB,GAAG,oBAAoB,GAAG,qBAAqB,CAAC;AAEpF,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC;AAElG,MAAM,WAAW,kBAAkB;IAC/B,MAAM,IAAI,kBAAkB,CAAC;IAE7B,IAAI,CAAC,EAAE,EAAE,kBAAkB,GAAG,kBAAkB,CAAC;IAEjD,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC,WAAW,CAAC,IAAI,EAAE;QACd,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,eAAe,EAAE,CAAC;QAC7B,aAAa,EAAE,MAAM,EAAE,CAAC;KAC3B,GA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