@wgb5445/aptos-intent-npm 0.0.11 → 0.1.0

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.
@@ -0,0 +1,223 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Wrapper to decompile script in its serialized form and wrap it with wasm errors.
5
+ * @param {Uint8Array} script
6
+ * @returns {(MoveFunctionCall)[]}
7
+ */
8
+ export function generate_batched_call_payload_wasm(script: Uint8Array): (MoveFunctionCall)[];
9
+ export interface AllocatedLocal {
10
+ op_type: ArgumentOperation;
11
+ is_parameter: boolean;
12
+ local_idx: number;
13
+ }
14
+
15
+ /**
16
+ * Arguments to the `MoveFunctionCall`.
17
+ */
18
+ export type CallArgument = { Raw: number[] } | { Signer: number } | { PreviousResult: PreviousResult };
19
+
20
+ export class AllocatedLocal {
21
+ free(): void;
22
+ }
23
+ export class BuilderCall {
24
+ free(): void;
25
+ }
26
+ export class IntoUnderlyingByteSource {
27
+ free(): void;
28
+ /**
29
+ * @param {any} controller
30
+ */
31
+ start(controller: any): void;
32
+ /**
33
+ * @param {any} controller
34
+ * @returns {Promise<any>}
35
+ */
36
+ pull(controller: any): Promise<any>;
37
+ cancel(): void;
38
+ readonly autoAllocateChunkSize: number;
39
+ readonly type: string;
40
+ }
41
+ export class IntoUnderlyingSink {
42
+ free(): void;
43
+ /**
44
+ * @param {any} chunk
45
+ * @returns {Promise<any>}
46
+ */
47
+ write(chunk: any): Promise<any>;
48
+ /**
49
+ * @returns {Promise<any>}
50
+ */
51
+ close(): Promise<any>;
52
+ /**
53
+ * @param {any} reason
54
+ * @returns {Promise<any>}
55
+ */
56
+ abort(reason: any): Promise<any>;
57
+ }
58
+ export class IntoUnderlyingSource {
59
+ free(): void;
60
+ /**
61
+ * @param {any} controller
62
+ * @returns {Promise<any>}
63
+ */
64
+ pull(controller: any): Promise<any>;
65
+ cancel(): void;
66
+ }
67
+ /**
68
+ * Calling a Move function.
69
+ *
70
+ * Similar to a public entry function call, but the arguments could specified as `CallArgument`,
71
+ * which can be a return value of a previous `MoveFunctionCall`.
72
+ */
73
+ export class MoveFunctionCall {
74
+ free(): void;
75
+ }
76
+ /**
77
+ * Raw options for [`pipeTo()`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/pipeTo).
78
+ */
79
+ export class PipeOptions {
80
+ free(): void;
81
+ readonly preventAbort: boolean;
82
+ readonly preventCancel: boolean;
83
+ readonly preventClose: boolean;
84
+ readonly signal: AbortSignal | undefined;
85
+ }
86
+ export class QueuingStrategy {
87
+ free(): void;
88
+ readonly highWaterMark: number;
89
+ }
90
+ /**
91
+ * Raw options for [`getReader()`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/getReader).
92
+ */
93
+ export class ReadableStreamGetReaderOptions {
94
+ free(): void;
95
+ readonly mode: any;
96
+ }
97
+ export class TransactionComposer {
98
+ free(): void;
99
+ /**
100
+ * Create a builder with one distinct signer available. This should be the default configuration.
101
+ * @returns {TransactionComposer}
102
+ */
103
+ static single_signer(): TransactionComposer;
104
+ /**
105
+ * Create a builder with one signer needed for script. This would be needed for multi-agent
106
+ * transaction where multiple signers are present.
107
+ * @param {number} signer_count
108
+ * @returns {TransactionComposer}
109
+ */
110
+ static multi_signer(signer_count: number): TransactionComposer;
111
+ /**
112
+ * Consume the builder and generate a serialized script with calls in the builder.
113
+ * @param {boolean} with_metadata
114
+ * @returns {Uint8Array}
115
+ */
116
+ generate_batched_calls(with_metadata: boolean): Uint8Array;
117
+ /**
118
+ * Load up a module from a remote endpoint. Will need to invoke this function prior to the
119
+ * call.
120
+ * @param {string} api_url
121
+ * @param {string} module_name
122
+ * @returns {Promise<void>}
123
+ */
124
+ load_module(api_url: string, module_name: string): Promise<void>;
125
+ /**
126
+ * Load up the dependency modules of a TypeTag from a remote endpoint.
127
+ * @param {string} api_url
128
+ * @param {string} type_tag
129
+ * @returns {Promise<void>}
130
+ */
131
+ load_type_tag(api_url: string, type_tag: string): Promise<void>;
132
+ /**
133
+ * This would be the core api for the `TransactionComposer`. The function would:
134
+ * - add the function call to the builder
135
+ * - allocate the locals and parameters needed for this function call
136
+ * - return the arguments back to the caller which could be passed into subsequent calls
137
+ * into `add_batched_call`.
138
+ *
139
+ * This function would also check for the ability and type safety when passing values
140
+ * into the function call, and will abort if there's a violation.
141
+ * @param {string} module
142
+ * @param {string} _function
143
+ * @param {(string)[]} ty_args
144
+ * @param {(CallArgument)[]} args
145
+ * @returns {(CallArgument)[]}
146
+ */
147
+ add_batched_call(module: string, _function: string, ty_args: (string)[], args: (CallArgument)[]): (CallArgument)[];
148
+ }
149
+
150
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
151
+
152
+ export interface InitOutput {
153
+ readonly memory: WebAssembly.Memory;
154
+ readonly __wbg_allocatedlocal_free: (a: number, b: number) => void;
155
+ readonly __wbg_buildercall_free: (a: number, b: number) => void;
156
+ readonly __wbg_transactioncomposer_free: (a: number, b: number) => void;
157
+ readonly transactioncomposer_single_signer: () => number;
158
+ readonly transactioncomposer_multi_signer: (a: number) => number;
159
+ readonly transactioncomposer_generate_batched_calls: (a: number, b: number, c: number) => void;
160
+ readonly transactioncomposer_load_module: (a: number, b: number, c: number, d: number, e: number) => number;
161
+ readonly transactioncomposer_load_type_tag: (a: number, b: number, c: number, d: number, e: number) => number;
162
+ readonly transactioncomposer_add_batched_call: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
163
+ readonly __wbg_movefunctioncall_free: (a: number, b: number) => void;
164
+ readonly callargument_new_bytes: (a: number, b: number) => number;
165
+ readonly callargument_new_signer: (a: number) => number;
166
+ readonly callargument_borrow: (a: number, b: number) => void;
167
+ readonly callargument_borrow_mut: (a: number, b: number) => void;
168
+ readonly callargument_copy: (a: number, b: number) => void;
169
+ readonly generate_batched_call_payload_wasm: (a: number, b: number, c: number) => void;
170
+ readonly __wbg_readablestreamgetreaderoptions_free: (a: number, b: number) => void;
171
+ readonly readablestreamgetreaderoptions_mode: (a: number) => number;
172
+ readonly __wbg_pipeoptions_free: (a: number, b: number) => void;
173
+ readonly pipeoptions_preventClose: (a: number) => number;
174
+ readonly pipeoptions_preventCancel: (a: number) => number;
175
+ readonly pipeoptions_preventAbort: (a: number) => number;
176
+ readonly pipeoptions_signal: (a: number) => number;
177
+ readonly __wbg_intounderlyingsource_free: (a: number, b: number) => void;
178
+ readonly intounderlyingsource_pull: (a: number, b: number) => number;
179
+ readonly intounderlyingsource_cancel: (a: number) => void;
180
+ readonly __wbg_intounderlyingbytesource_free: (a: number, b: number) => void;
181
+ readonly intounderlyingbytesource_type: (a: number, b: number) => void;
182
+ readonly intounderlyingbytesource_autoAllocateChunkSize: (a: number) => number;
183
+ readonly intounderlyingbytesource_start: (a: number, b: number) => void;
184
+ readonly intounderlyingbytesource_pull: (a: number, b: number) => number;
185
+ readonly intounderlyingbytesource_cancel: (a: number) => void;
186
+ readonly __wbg_queuingstrategy_free: (a: number, b: number) => void;
187
+ readonly queuingstrategy_highWaterMark: (a: number) => number;
188
+ readonly __wbg_intounderlyingsink_free: (a: number, b: number) => void;
189
+ readonly intounderlyingsink_write: (a: number, b: number) => number;
190
+ readonly intounderlyingsink_close: (a: number) => number;
191
+ readonly intounderlyingsink_abort: (a: number, b: number) => number;
192
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
193
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
194
+ readonly __wbindgen_export_2: WebAssembly.Table;
195
+ readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h9d36ae248074657d: (a: number, b: number, c: number) => void;
196
+ readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
197
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
198
+ readonly __wbindgen_exn_store: (a: number) => void;
199
+ readonly wasm_bindgen__convert__closures__invoke2_mut__h0d57cb0f99d3b458: (a: number, b: number, c: number, d: number) => void;
200
+ }
201
+
202
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
203
+ /**
204
+ * Instantiates the given `module`, which can either be bytes or
205
+ * a precompiled `WebAssembly.Module`.
206
+ *
207
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
208
+ *
209
+ * @returns {InitOutput}
210
+ */
211
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
212
+
213
+ /**
214
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
215
+ * for everything else, calls `WebAssembly.instantiate` directly.
216
+ *
217
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
218
+ *
219
+ * @returns {Promise<InitOutput>}
220
+ */
221
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
222
+
223
+ export function aptos_dynamic_transaction_composer_bg(imports: any): Promise<WebAssembly.Module>