@picon-finance/dlmm-sdk 1.0.0 → 1.2.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.
@@ -1,9 +1,100 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export interface Bin {
4
+ amountX: bigint;
5
+ amountY: bigint;
6
+ price: bigint;
7
+ }
8
+
9
+ export interface BinArray {
10
+ index: number;
11
+ bins: Bin[];
12
+ }
13
+
14
+ export interface DynamicFeeConfig {
15
+ filterPeriod: number;
16
+ decayPeriod: number;
17
+ reductionFactor: number;
18
+ dynamicFeeControl: number;
19
+ maxVolatilityAccumulator: number;
20
+ }
21
+
22
+ export interface DynamicFeeState {
23
+ config: DynamicFeeConfig;
24
+ referenceBinId: number;
25
+ volatilityReference: number;
26
+ volatilityAccumulator: number;
27
+ lastUpdateTimestamp: bigint;
28
+ }
29
+
30
+ export interface PoolState {
31
+ binStep: number;
32
+ feeRate: number;
33
+ protocolShare: number;
34
+ activeBinId: number;
35
+ dynamicFeeState: DynamicFeeState;
36
+ }
37
+
38
+ export interface QuoteInput {
39
+ amountIn: bigint;
40
+ xToY: boolean;
41
+ slippageToleranceBps: number;
42
+ now: bigint;
43
+ poolState: PoolState;
44
+ binArrays: (BinArray | undefined)[];
45
+ inputTransferFee?: TransferFee;
46
+ outputTransferFee?: TransferFee;
47
+ }
48
+
49
+ export interface QuoteOutput {
50
+ amountIn: bigint;
51
+ amountOut: bigint;
52
+ minAmountOut: bigint;
53
+ fee: bigint;
54
+ feeRateMin: bigint;
55
+ feeRateMax: bigint;
56
+ }
57
+
58
+ export interface TransferFee {
59
+ feeBps: number;
60
+ maxFee: bigint;
61
+ }
62
+
63
+
64
+ export function quote(input: QuoteInput): QuoteOutput;
65
+
66
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
67
+
68
+ export interface InitOutput {
69
+ readonly memory: WebAssembly.Memory;
70
+ readonly quote: (a: any) => [number, number, number];
71
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
72
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
73
+ readonly __wbindgen_exn_store: (a: number) => void;
74
+ readonly __externref_table_alloc: () => number;
75
+ readonly __wbindgen_externrefs: WebAssembly.Table;
76
+ readonly __externref_table_dealloc: (a: number) => void;
77
+ readonly __wbindgen_start: () => void;
78
+ }
79
+
80
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
81
+
1
82
  /**
2
- * @param {QuoteInput} input
3
- * @returns {QuoteOutput}
83
+ * Instantiates the given `module`, which can either be bytes or
84
+ * a precompiled `WebAssembly.Module`.
85
+ *
86
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
87
+ *
88
+ * @returns {InitOutput}
4
89
  */
5
- export declare function quote(input: QuoteInput): QuoteOutput;
6
- declare function initSync(module: any): any;
7
- declare function __wbg_init(module_or_path: any): Promise<any>;
8
- export { initSync, __wbg_init as default };
9
- //# sourceMappingURL=picon_dlmm_quote.d.ts.map
90
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
91
+
92
+ /**
93
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
94
+ * for everything else, calls `WebAssembly.instantiate` directly.
95
+ *
96
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
97
+ *
98
+ * @returns {Promise<InitOutput>}
99
+ */
100
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
@@ -1,4 +1,5 @@
1
1
  /* @ts-self-types="./picon_dlmm_quote.d.ts" */
2
+
2
3
  /**
3
4
  * @param {QuoteInput} input
4
5
  * @returns {QuoteOutput}
@@ -13,209 +14,201 @@ export function quote(input) {
13
14
  function __wbg_get_imports() {
14
15
  const import0 = {
15
16
  __proto__: null,
16
- __wbg_Error_92b29b0548f8b746: function (arg0, arg1) {
17
+ __wbg_Error_92b29b0548f8b746: function(arg0, arg1) {
17
18
  const ret = Error(getStringFromWasm0(arg0, arg1));
18
19
  return ret;
19
20
  },
20
- __wbg_Number_9a4e0ecb0fa16705: function (arg0) {
21
+ __wbg_Number_9a4e0ecb0fa16705: function(arg0) {
21
22
  const ret = Number(arg0);
22
23
  return ret;
23
24
  },
24
- __wbg_String_8564e559799eccda: function (arg0, arg1) {
25
+ __wbg_String_8564e559799eccda: function(arg0, arg1) {
25
26
  const ret = String(arg1);
26
27
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
27
28
  const len1 = WASM_VECTOR_LEN;
28
29
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
29
30
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
30
31
  },
31
- __wbg___wbindgen_bigint_get_as_i64_d968e41184ae354f: function (arg0, arg1) {
32
+ __wbg___wbindgen_bigint_get_as_i64_d968e41184ae354f: function(arg0, arg1) {
32
33
  const v = arg1;
33
- const ret = typeof (v) === 'bigint' ? v : undefined;
34
+ const ret = typeof(v) === 'bigint' ? v : undefined;
34
35
  getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
35
36
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
36
37
  },
37
- __wbg___wbindgen_boolean_get_fa956cfa2d1bd751: function (arg0) {
38
+ __wbg___wbindgen_boolean_get_fa956cfa2d1bd751: function(arg0) {
38
39
  const v = arg0;
39
- const ret = typeof (v) === 'boolean' ? v : undefined;
40
+ const ret = typeof(v) === 'boolean' ? v : undefined;
40
41
  return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
41
42
  },
42
- __wbg___wbindgen_debug_string_c25d447a39f5578f: function (arg0, arg1) {
43
+ __wbg___wbindgen_debug_string_c25d447a39f5578f: function(arg0, arg1) {
43
44
  const ret = debugString(arg1);
44
45
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
45
46
  const len1 = WASM_VECTOR_LEN;
46
47
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
47
48
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
48
49
  },
49
- __wbg___wbindgen_in_aca499c5de7ff5e5: function (arg0, arg1) {
50
+ __wbg___wbindgen_in_aca499c5de7ff5e5: function(arg0, arg1) {
50
51
  const ret = arg0 in arg1;
51
52
  return ret;
52
53
  },
53
- __wbg___wbindgen_is_bigint_2f76dc55065b4273: function (arg0) {
54
- const ret = typeof (arg0) === 'bigint';
54
+ __wbg___wbindgen_is_bigint_2f76dc55065b4273: function(arg0) {
55
+ const ret = typeof(arg0) === 'bigint';
55
56
  return ret;
56
57
  },
57
- __wbg___wbindgen_is_function_1ff95bcc5517c252: function (arg0) {
58
- const ret = typeof (arg0) === 'function';
58
+ __wbg___wbindgen_is_function_1ff95bcc5517c252: function(arg0) {
59
+ const ret = typeof(arg0) === 'function';
59
60
  return ret;
60
61
  },
61
- __wbg___wbindgen_is_object_a27215656b807791: function (arg0) {
62
+ __wbg___wbindgen_is_object_a27215656b807791: function(arg0) {
62
63
  const val = arg0;
63
- const ret = typeof (val) === 'object' && val !== null;
64
+ const ret = typeof(val) === 'object' && val !== null;
64
65
  return ret;
65
66
  },
66
- __wbg___wbindgen_is_undefined_c05833b95a3cf397: function (arg0) {
67
+ __wbg___wbindgen_is_undefined_c05833b95a3cf397: function(arg0) {
67
68
  const ret = arg0 === undefined;
68
69
  return ret;
69
70
  },
70
- __wbg___wbindgen_jsval_eq_e659fcf7b0e32763: function (arg0, arg1) {
71
+ __wbg___wbindgen_jsval_eq_e659fcf7b0e32763: function(arg0, arg1) {
71
72
  const ret = arg0 === arg1;
72
73
  return ret;
73
74
  },
74
- __wbg___wbindgen_jsval_loose_eq_db4c3b15f63fc170: function (arg0, arg1) {
75
+ __wbg___wbindgen_jsval_loose_eq_db4c3b15f63fc170: function(arg0, arg1) {
75
76
  const ret = arg0 == arg1;
76
77
  return ret;
77
78
  },
78
- __wbg___wbindgen_number_get_394265ed1e1b84ee: function (arg0, arg1) {
79
+ __wbg___wbindgen_number_get_394265ed1e1b84ee: function(arg0, arg1) {
79
80
  const obj = arg1;
80
- const ret = typeof (obj) === 'number' ? obj : undefined;
81
+ const ret = typeof(obj) === 'number' ? obj : undefined;
81
82
  getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
82
83
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
83
84
  },
84
- __wbg___wbindgen_shr_ad10001a7b001d7f: function (arg0, arg1) {
85
+ __wbg___wbindgen_shr_ad10001a7b001d7f: function(arg0, arg1) {
85
86
  const ret = arg0 >> arg1;
86
87
  return ret;
87
88
  },
88
- __wbg___wbindgen_string_get_b0ca35b86a603356: function (arg0, arg1) {
89
+ __wbg___wbindgen_string_get_b0ca35b86a603356: function(arg0, arg1) {
89
90
  const obj = arg1;
90
- const ret = typeof (obj) === 'string' ? obj : undefined;
91
+ const ret = typeof(obj) === 'string' ? obj : undefined;
91
92
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
92
93
  var len1 = WASM_VECTOR_LEN;
93
94
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
94
95
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
95
96
  },
96
- __wbg___wbindgen_throw_344f42d3211c4765: function (arg0, arg1) {
97
+ __wbg___wbindgen_throw_344f42d3211c4765: function(arg0, arg1) {
97
98
  throw new Error(getStringFromWasm0(arg0, arg1));
98
99
  },
99
- __wbg_call_8a2dd23819f8a60a: function () {
100
- return handleError(function (arg0, arg1) {
101
- const ret = arg0.call(arg1);
102
- return ret;
103
- }, arguments);
104
- },
105
- __wbg_done_89b2b13e91a60321: function (arg0) {
100
+ __wbg_call_8a2dd23819f8a60a: function() { return handleError(function (arg0, arg1) {
101
+ const ret = arg0.call(arg1);
102
+ return ret;
103
+ }, arguments); },
104
+ __wbg_done_89b2b13e91a60321: function(arg0) {
106
105
  const ret = arg0.done;
107
106
  return ret;
108
107
  },
109
- __wbg_get_c7eb1f358a7654df: function () {
110
- return handleError(function (arg0, arg1) {
111
- const ret = Reflect.get(arg0, arg1);
112
- return ret;
113
- }, arguments);
114
- },
115
- __wbg_get_unchecked_6e0ad6d2a41b06f6: function (arg0, arg1) {
108
+ __wbg_get_c7eb1f358a7654df: function() { return handleError(function (arg0, arg1) {
109
+ const ret = Reflect.get(arg0, arg1);
110
+ return ret;
111
+ }, arguments); },
112
+ __wbg_get_unchecked_6e0ad6d2a41b06f6: function(arg0, arg1) {
116
113
  const ret = arg0[arg1 >>> 0];
117
114
  return ret;
118
115
  },
119
- __wbg_get_with_ref_key_6412cf3094599694: function (arg0, arg1) {
116
+ __wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
120
117
  const ret = arg0[arg1];
121
118
  return ret;
122
119
  },
123
- __wbg_instanceof_ArrayBuffer_4480b9e0068a8adb: function (arg0) {
120
+ __wbg_instanceof_ArrayBuffer_4480b9e0068a8adb: function(arg0) {
124
121
  let result;
125
122
  try {
126
123
  result = arg0 instanceof ArrayBuffer;
127
- }
128
- catch (_) {
124
+ } catch (_) {
129
125
  result = false;
130
126
  }
131
127
  const ret = result;
132
128
  return ret;
133
129
  },
134
- __wbg_instanceof_Uint8Array_309b927aaf7a3fc7: function (arg0) {
130
+ __wbg_instanceof_Uint8Array_309b927aaf7a3fc7: function(arg0) {
135
131
  let result;
136
132
  try {
137
133
  result = arg0 instanceof Uint8Array;
138
- }
139
- catch (_) {
134
+ } catch (_) {
140
135
  result = false;
141
136
  }
142
137
  const ret = result;
143
138
  return ret;
144
139
  },
145
- __wbg_isArray_0677c962b281d01a: function (arg0) {
140
+ __wbg_isArray_0677c962b281d01a: function(arg0) {
146
141
  const ret = Array.isArray(arg0);
147
142
  return ret;
148
143
  },
149
- __wbg_isSafeInteger_04f36e4056f1b851: function (arg0) {
144
+ __wbg_isSafeInteger_04f36e4056f1b851: function(arg0) {
150
145
  const ret = Number.isSafeInteger(arg0);
151
146
  return ret;
152
147
  },
153
- __wbg_iterator_6f722e4a93058b71: function () {
148
+ __wbg_iterator_6f722e4a93058b71: function() {
154
149
  const ret = Symbol.iterator;
155
150
  return ret;
156
151
  },
157
- __wbg_length_1f0964f4a5e2c6d8: function (arg0) {
152
+ __wbg_length_1f0964f4a5e2c6d8: function(arg0) {
158
153
  const ret = arg0.length;
159
154
  return ret;
160
155
  },
161
- __wbg_length_370319915dc99107: function (arg0) {
156
+ __wbg_length_370319915dc99107: function(arg0) {
162
157
  const ret = arg0.length;
163
158
  return ret;
164
159
  },
165
- __wbg_new_cd45aabdf6073e84: function (arg0) {
160
+ __wbg_new_cd45aabdf6073e84: function(arg0) {
166
161
  const ret = new Uint8Array(arg0);
167
162
  return ret;
168
163
  },
169
- __wbg_new_da52cf8fe3429cb2: function () {
164
+ __wbg_new_da52cf8fe3429cb2: function() {
170
165
  const ret = new Object();
171
166
  return ret;
172
167
  },
173
- __wbg_next_6dbf2c0ac8cde20f: function (arg0) {
168
+ __wbg_next_6dbf2c0ac8cde20f: function(arg0) {
174
169
  const ret = arg0.next;
175
170
  return ret;
176
171
  },
177
- __wbg_next_71f2aa1cb3d1e37e: function () {
178
- return handleError(function (arg0) {
179
- const ret = arg0.next();
180
- return ret;
181
- }, arguments);
182
- },
183
- __wbg_prototypesetcall_4770620bbe4688a0: function (arg0, arg1, arg2) {
172
+ __wbg_next_71f2aa1cb3d1e37e: function() { return handleError(function (arg0) {
173
+ const ret = arg0.next();
174
+ return ret;
175
+ }, arguments); },
176
+ __wbg_prototypesetcall_4770620bbe4688a0: function(arg0, arg1, arg2) {
184
177
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
185
178
  },
186
- __wbg_set_6be42768c690e380: function (arg0, arg1, arg2) {
179
+ __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
187
180
  arg0[arg1] = arg2;
188
181
  },
189
- __wbg_value_a5d5488a9589444a: function (arg0) {
182
+ __wbg_value_a5d5488a9589444a: function(arg0) {
190
183
  const ret = arg0.value;
191
184
  return ret;
192
185
  },
193
- __wbindgen_cast_0000000000000001: function (arg0) {
186
+ __wbindgen_cast_0000000000000001: function(arg0) {
194
187
  // Cast intrinsic for `F64 -> Externref`.
195
188
  const ret = arg0;
196
189
  return ret;
197
190
  },
198
- __wbindgen_cast_0000000000000002: function (arg0) {
191
+ __wbindgen_cast_0000000000000002: function(arg0) {
199
192
  // Cast intrinsic for `I64 -> Externref`.
200
193
  const ret = arg0;
201
194
  return ret;
202
195
  },
203
- __wbindgen_cast_0000000000000003: function (arg0, arg1) {
196
+ __wbindgen_cast_0000000000000003: function(arg0, arg1) {
204
197
  // Cast intrinsic for `Ref(String) -> Externref`.
205
198
  const ret = getStringFromWasm0(arg0, arg1);
206
199
  return ret;
207
200
  },
208
- __wbindgen_cast_0000000000000004: function (arg0, arg1) {
201
+ __wbindgen_cast_0000000000000004: function(arg0, arg1) {
209
202
  // Cast intrinsic for `U128 -> Externref`.
210
203
  const ret = (BigInt.asUintN(64, arg0) | (BigInt.asUintN(64, arg1) << BigInt(64)));
211
204
  return ret;
212
205
  },
213
- __wbindgen_cast_0000000000000005: function (arg0) {
206
+ __wbindgen_cast_0000000000000005: function(arg0) {
214
207
  // Cast intrinsic for `U64 -> Externref`.
215
208
  const ret = BigInt.asUintN(64, arg0);
216
209
  return ret;
217
210
  },
218
- __wbindgen_init_externref_table: function () {
211
+ __wbindgen_init_externref_table: function() {
219
212
  const table = wasm.__wbindgen_externrefs;
220
213
  const offset = table.grow(4);
221
214
  table.set(0, undefined);
@@ -230,16 +223,18 @@ function __wbg_get_imports() {
230
223
  "./picon_dlmm_quote_bg.js": import0,
231
224
  };
232
225
  }
226
+
233
227
  function addToExternrefTable0(obj) {
234
228
  const idx = wasm.__externref_table_alloc();
235
229
  wasm.__wbindgen_externrefs.set(idx, obj);
236
230
  return idx;
237
231
  }
232
+
238
233
  function debugString(val) {
239
234
  // primitive types
240
235
  const type = typeof val;
241
236
  if (type == 'number' || type == 'boolean' || val == null) {
242
- return `${val}`;
237
+ return `${val}`;
243
238
  }
244
239
  if (type == 'string') {
245
240
  return `"${val}"`;
@@ -248,8 +243,7 @@ function debugString(val) {
248
243
  const description = val.description;
249
244
  if (description == null) {
250
245
  return 'Symbol';
251
- }
252
- else {
246
+ } else {
253
247
  return `Symbol(${description})`;
254
248
  }
255
249
  }
@@ -257,8 +251,7 @@ function debugString(val) {
257
251
  const name = val.name;
258
252
  if (typeof name == 'string' && name.length > 0) {
259
253
  return `Function(${name})`;
260
- }
261
- else {
254
+ } else {
262
255
  return 'Function';
263
256
  }
264
257
  }
@@ -269,7 +262,7 @@ function debugString(val) {
269
262
  if (length > 0) {
270
263
  debug += debugString(val[0]);
271
264
  }
272
- for (let i = 1; i < length; i++) {
265
+ for(let i = 1; i < length; i++) {
273
266
  debug += ', ' + debugString(val[i]);
274
267
  }
275
268
  debug += ']';
@@ -280,8 +273,7 @@ function debugString(val) {
280
273
  let className;
281
274
  if (builtInMatches && builtInMatches.length > 1) {
282
275
  className = builtInMatches[1];
283
- }
284
- else {
276
+ } else {
285
277
  // Failed to match the standard '[object ClassName]'
286
278
  return toString.call(val);
287
279
  }
@@ -291,8 +283,7 @@ function debugString(val) {
291
283
  // easier than looping through ownProperties of `val`.
292
284
  try {
293
285
  return 'Object(' + JSON.stringify(val) + ')';
294
- }
295
- catch (_) {
286
+ } catch (_) {
296
287
  return 'Object';
297
288
  }
298
289
  }
@@ -303,10 +294,12 @@ function debugString(val) {
303
294
  // TODO we could test for more things here, like `Set`s and `Map`s.
304
295
  return className;
305
296
  }
297
+
306
298
  function getArrayU8FromWasm0(ptr, len) {
307
299
  ptr = ptr >>> 0;
308
300
  return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
309
301
  }
302
+
310
303
  let cachedDataViewMemory0 = null;
311
304
  function getDataViewMemory0() {
312
305
  if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
@@ -314,9 +307,11 @@ function getDataViewMemory0() {
314
307
  }
315
308
  return cachedDataViewMemory0;
316
309
  }
310
+
317
311
  function getStringFromWasm0(ptr, len) {
318
312
  return decodeText(ptr >>> 0, len);
319
313
  }
314
+
320
315
  let cachedUint8ArrayMemory0 = null;
321
316
  function getUint8ArrayMemory0() {
322
317
  if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
@@ -324,18 +319,20 @@ function getUint8ArrayMemory0() {
324
319
  }
325
320
  return cachedUint8ArrayMemory0;
326
321
  }
322
+
327
323
  function handleError(f, args) {
328
324
  try {
329
325
  return f.apply(this, args);
330
- }
331
- catch (e) {
326
+ } catch (e) {
332
327
  const idx = addToExternrefTable0(e);
333
328
  wasm.__wbindgen_exn_store(idx);
334
329
  }
335
330
  }
331
+
336
332
  function isLikeNone(x) {
337
333
  return x === undefined || x === null;
338
334
  }
335
+
339
336
  function passStringToWasm0(arg, malloc, realloc) {
340
337
  if (realloc === undefined) {
341
338
  const buf = cachedTextEncoder.encode(arg);
@@ -344,14 +341,17 @@ function passStringToWasm0(arg, malloc, realloc) {
344
341
  WASM_VECTOR_LEN = buf.length;
345
342
  return ptr;
346
343
  }
344
+
347
345
  let len = arg.length;
348
346
  let ptr = malloc(len, 1) >>> 0;
347
+
349
348
  const mem = getUint8ArrayMemory0();
349
+
350
350
  let offset = 0;
351
+
351
352
  for (; offset < len; offset++) {
352
353
  const code = arg.charCodeAt(offset);
353
- if (code > 0x7F)
354
- break;
354
+ if (code > 0x7F) break;
355
355
  mem[ptr + offset] = code;
356
356
  }
357
357
  if (offset !== len) {
@@ -361,17 +361,21 @@ function passStringToWasm0(arg, malloc, realloc) {
361
361
  ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
362
362
  const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
363
363
  const ret = cachedTextEncoder.encodeInto(arg, view);
364
+
364
365
  offset += ret.written;
365
366
  ptr = realloc(ptr, len, offset, 1) >>> 0;
366
367
  }
368
+
367
369
  WASM_VECTOR_LEN = offset;
368
370
  return ptr;
369
371
  }
372
+
370
373
  function takeFromExternrefTable0(idx) {
371
374
  const value = wasm.__wbindgen_externrefs.get(idx);
372
375
  wasm.__externref_table_dealloc(idx);
373
376
  return value;
374
377
  }
378
+
375
379
  let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
376
380
  cachedTextDecoder.decode();
377
381
  const MAX_SAFARI_DECODE_BYTES = 2146435072;
@@ -385,7 +389,9 @@ function decodeText(ptr, len) {
385
389
  }
386
390
  return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
387
391
  }
392
+
388
393
  const cachedTextEncoder = new TextEncoder();
394
+
389
395
  if (!('encodeInto' in cachedTextEncoder)) {
390
396
  cachedTextEncoder.encodeInto = function (arg, view) {
391
397
  const buf = cachedTextEncoder.encode(arg);
@@ -396,7 +402,9 @@ if (!('encodeInto' in cachedTextEncoder)) {
396
402
  };
397
403
  };
398
404
  }
405
+
399
406
  let WASM_VECTOR_LEN = 0;
407
+
400
408
  let wasmModule, wasmInstance, wasm;
401
409
  function __wbg_finalize_init(instance, module) {
402
410
  wasmInstance = instance;
@@ -407,54 +415,54 @@ function __wbg_finalize_init(instance, module) {
407
415
  wasm.__wbindgen_start();
408
416
  return wasm;
409
417
  }
418
+
410
419
  async function __wbg_load(module, imports) {
411
420
  if (typeof Response === 'function' && module instanceof Response) {
412
421
  if (typeof WebAssembly.instantiateStreaming === 'function') {
413
422
  try {
414
423
  return await WebAssembly.instantiateStreaming(module, imports);
415
- }
416
- catch (e) {
424
+ } catch (e) {
417
425
  const validResponse = module.ok && expectedResponseType(module.type);
426
+
418
427
  if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
419
428
  console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
420
- }
421
- else {
422
- throw e;
423
- }
429
+
430
+ } else { throw e; }
424
431
  }
425
432
  }
433
+
426
434
  const bytes = await module.arrayBuffer();
427
435
  return await WebAssembly.instantiate(bytes, imports);
428
- }
429
- else {
436
+ } else {
430
437
  const instance = await WebAssembly.instantiate(module, imports);
438
+
431
439
  if (instance instanceof WebAssembly.Instance) {
432
440
  return { instance, module };
433
- }
434
- else {
441
+ } else {
435
442
  return instance;
436
443
  }
437
444
  }
445
+
438
446
  function expectedResponseType(type) {
439
447
  switch (type) {
440
- case 'basic':
441
- case 'cors':
442
- case 'default': return true;
448
+ case 'basic': case 'cors': case 'default': return true;
443
449
  }
444
450
  return false;
445
451
  }
446
452
  }
453
+
447
454
  function initSync(module) {
448
- if (wasm !== undefined)
449
- return wasm;
455
+ if (wasm !== undefined) return wasm;
456
+
457
+
450
458
  if (module !== undefined) {
451
459
  if (Object.getPrototypeOf(module) === Object.prototype) {
452
- ({ module } = module);
453
- }
454
- else {
455
- console.warn('using deprecated parameters for `initSync()`; pass a single object instead');
460
+ ({module} = module)
461
+ } else {
462
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
456
463
  }
457
464
  }
465
+
458
466
  const imports = __wbg_get_imports();
459
467
  if (!(module instanceof WebAssembly.Module)) {
460
468
  module = new WebAssembly.Module(module);
@@ -462,25 +470,31 @@ function initSync(module) {
462
470
  const instance = new WebAssembly.Instance(module, imports);
463
471
  return __wbg_finalize_init(instance, module);
464
472
  }
473
+
465
474
  async function __wbg_init(module_or_path) {
466
- if (wasm !== undefined)
467
- return wasm;
475
+ if (wasm !== undefined) return wasm;
476
+
477
+
468
478
  if (module_or_path !== undefined) {
469
479
  if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
470
- ({ module_or_path } = module_or_path);
471
- }
472
- else {
473
- console.warn('using deprecated parameters for the initialization function; pass a single object instead');
480
+ ({module_or_path} = module_or_path)
481
+ } else {
482
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
474
483
  }
475
484
  }
485
+
476
486
  if (module_or_path === undefined) {
477
487
  module_or_path = new URL('picon_dlmm_quote_bg.wasm', import.meta.url);
478
488
  }
479
489
  const imports = __wbg_get_imports();
490
+
480
491
  if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
481
492
  module_or_path = fetch(module_or_path);
482
493
  }
494
+
483
495
  const { instance, module } = await __wbg_load(await module_or_path, imports);
496
+
484
497
  return __wbg_finalize_init(instance, module);
485
498
  }
499
+
486
500
  export { initSync, __wbg_init as default };
@@ -0,0 +1,11 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export const memory: WebAssembly.Memory;
4
+ export const quote: (a: any) => [number, number, number];
5
+ export const __wbindgen_malloc: (a: number, b: number) => number;
6
+ export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
7
+ export const __wbindgen_exn_store: (a: number) => void;
8
+ export const __externref_table_alloc: () => number;
9
+ export const __wbindgen_externrefs: WebAssembly.Table;
10
+ export const __externref_table_dealloc: (a: number) => void;
11
+ export const __wbindgen_start: () => void;