@aptos-labs/script-composer-pack 0.0.6 → 0.0.8

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/cjs/main.js CHANGED
@@ -31,10 +31,10 @@ __export(main_exports, {
31
31
  PreviousResult: () => PreviousResult,
32
32
  QueuingStrategy: () => QueuingStrategy,
33
33
  ReadableStreamGetReaderOptions: () => ReadableStreamGetReaderOptions,
34
+ ScriptComposerWasm: () => ScriptComposerWasm,
34
35
  TransactionComposer: () => TransactionComposer,
35
36
  generate_batched_call_payload_wasm: () => generate_batched_call_payload_wasm,
36
- initSync: () => initSync,
37
- wasm: () => wasm3
37
+ initSync: () => initSync
38
38
  });
39
39
  module.exports = __toCommonJS(main_exports);
40
40
 
@@ -1222,7 +1222,15 @@ async function __wbg_init(module_or_path) {
1222
1222
  }
1223
1223
 
1224
1224
  // main.mts
1225
- var wasm3 = new WebAssembly.Module(new Uint8Array(aptos_dynamic_transaction_composer_bg_default));
1225
+ var ScriptComposerWasm = class {
1226
+ static init() {
1227
+ if (!this.isInitialized) {
1228
+ this.wasm = new WebAssembly.Module(new Uint8Array(aptos_dynamic_transaction_composer_bg_default));
1229
+ this.isInitialized = true;
1230
+ }
1231
+ }
1232
+ };
1233
+ ScriptComposerWasm.isInitialized = false;
1226
1234
  // Annotate the CommonJS export names for ESM import in node:
1227
1235
  0 && (module.exports = {
1228
1236
  AllocatedLocal,
@@ -1236,8 +1244,8 @@ var wasm3 = new WebAssembly.Module(new Uint8Array(aptos_dynamic_transaction_comp
1236
1244
  PreviousResult,
1237
1245
  QueuingStrategy,
1238
1246
  ReadableStreamGetReaderOptions,
1247
+ ScriptComposerWasm,
1239
1248
  TransactionComposer,
1240
1249
  generate_batched_call_payload_wasm,
1241
- initSync,
1242
- wasm
1250
+ initSync
1243
1251
  });
package/dist/esm/main.mjs CHANGED
@@ -1182,7 +1182,15 @@ async function __wbg_init(module_or_path) {
1182
1182
  }
1183
1183
 
1184
1184
  // main.mts
1185
- var wasm3 = new WebAssembly.Module(new Uint8Array(aptos_dynamic_transaction_composer_bg_default));
1185
+ var ScriptComposerWasm = class {
1186
+ static init() {
1187
+ if (!this.isInitialized) {
1188
+ this.wasm = new WebAssembly.Module(new Uint8Array(aptos_dynamic_transaction_composer_bg_default));
1189
+ this.isInitialized = true;
1190
+ }
1191
+ }
1192
+ };
1193
+ ScriptComposerWasm.isInitialized = false;
1186
1194
  export {
1187
1195
  AllocatedLocal,
1188
1196
  BuilderCall,
@@ -1195,8 +1203,8 @@ export {
1195
1203
  PreviousResult,
1196
1204
  QueuingStrategy,
1197
1205
  ReadableStreamGetReaderOptions,
1206
+ ScriptComposerWasm,
1198
1207
  TransactionComposer,
1199
1208
  generate_batched_call_payload_wasm,
1200
- initSync,
1201
- wasm3 as wasm
1209
+ initSync
1202
1210
  };
package/dist/main.d.mts CHANGED
@@ -235,6 +235,10 @@ type SyncInitInput = BufferSource | WebAssembly.Module;
235
235
  */
236
236
  declare function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
237
237
 
238
- declare const wasm: WebAssembly.Module;
238
+ declare class ScriptComposerWasm {
239
+ static wasm?: WebAssembly.Module;
240
+ static isInitialized: boolean;
241
+ static init(): void;
242
+ }
239
243
 
240
- export { AllocatedLocal, BuilderCall, CallArgument, type InitInput, type InitOutput, IntoUnderlyingByteSource, IntoUnderlyingSink, IntoUnderlyingSource, MoveFunctionCall, PipeOptions, PreviousResult, QueuingStrategy, ReadableStreamGetReaderOptions, type SyncInitInput, TransactionComposer, generate_batched_call_payload_wasm, initSync, wasm };
244
+ export { AllocatedLocal, BuilderCall, CallArgument, type InitInput, type InitOutput, IntoUnderlyingByteSource, IntoUnderlyingSink, IntoUnderlyingSource, MoveFunctionCall, PipeOptions, PreviousResult, QueuingStrategy, ReadableStreamGetReaderOptions, ScriptComposerWasm, type SyncInitInput, TransactionComposer, generate_batched_call_payload_wasm, initSync };
package/dist/main.d.ts CHANGED
@@ -235,6 +235,10 @@ type SyncInitInput = BufferSource | WebAssembly.Module;
235
235
  */
236
236
  declare function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
237
237
 
238
- declare const wasm: WebAssembly.Module;
238
+ declare class ScriptComposerWasm {
239
+ static wasm?: WebAssembly.Module;
240
+ static isInitialized: boolean;
241
+ static init(): void;
242
+ }
239
243
 
240
- export { AllocatedLocal, BuilderCall, CallArgument, type InitInput, type InitOutput, IntoUnderlyingByteSource, IntoUnderlyingSink, IntoUnderlyingSource, MoveFunctionCall, PipeOptions, PreviousResult, QueuingStrategy, ReadableStreamGetReaderOptions, type SyncInitInput, TransactionComposer, generate_batched_call_payload_wasm, initSync, wasm };
244
+ export { AllocatedLocal, BuilderCall, CallArgument, type InitInput, type InitOutput, IntoUnderlyingByteSource, IntoUnderlyingSink, IntoUnderlyingSource, MoveFunctionCall, PipeOptions, PreviousResult, QueuingStrategy, ReadableStreamGetReaderOptions, ScriptComposerWasm, type SyncInitInput, TransactionComposer, generate_batched_call_payload_wasm, initSync };
package/main.mts CHANGED
@@ -1,5 +1,15 @@
1
1
  // @ts-ignore
2
2
  import * as wasmModule from './node_modules/@aptos-labs/aptos-dynamic-transaction-composer/aptos_dynamic_transaction_composer_bg.wasm';
3
3
  export * from "./node_modules/@aptos-labs/aptos-dynamic-transaction-composer/aptos_dynamic_transaction_composer.js";
4
- const wasm = new WebAssembly.Module(new Uint8Array(wasmModule.default));
5
- export { wasm };
4
+ export class ScriptComposerWasm {
5
+ static wasm?: WebAssembly.Module;
6
+
7
+ static isInitialized = false;
8
+
9
+ static init() {
10
+ if (!this.isInitialized) {
11
+ this.wasm = new WebAssembly.Module(new Uint8Array(wasmModule.default));
12
+ this.isInitialized = true;
13
+ }
14
+ }
15
+ }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "Aptos Labs <opensource@aptoslabs.com>"
5
5
  ],
6
6
  "description": "Generating Move Script from composer",
7
- "version": "0.0.6",
7
+ "version": "0.0.8",
8
8
  "license": "Apache-2.0",
9
9
  "repository": {
10
10
  "type": "git",
@@ -33,8 +33,14 @@
33
33
  "exports": {
34
34
  ".": {
35
35
  "types": "./dist/main.d.ts",
36
- "import": "./dist/esm/main.mjs",
37
- "default": "./dist/cjs/main.js"
36
+ "import": {
37
+ "types": "./dist/main.d.ts",
38
+ "default": "./dist/esm/main.mjs"
39
+ },
40
+ "default": {
41
+ "types": "./dist/main.d.ts",
42
+ "default": "./dist/cjs/main.js"
43
+ }
38
44
  }
39
45
  },
40
46
  "dependencies": {