@orca-so/whirlpools-core 0.4.2 → 1.0.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.
- package/dist/browser/orca_whirlpools_core_js_bindings.d.ts +128 -128
- package/dist/browser/orca_whirlpools_core_js_bindings_bg.js +561 -568
- package/dist/browser/orca_whirlpools_core_js_bindings_bg.wasm +0 -0
- package/dist/browser/orca_whirlpools_core_js_bindings_bg.wasm.d.ts +70 -70
- package/dist/nodejs/orca_whirlpools_core_js_bindings.d.ts +128 -128
- package/dist/nodejs/orca_whirlpools_core_js_bindings.js +562 -569
- package/dist/nodejs/orca_whirlpools_core_js_bindings_bg.wasm +0 -0
- package/dist/nodejs/orca_whirlpools_core_js_bindings_bg.wasm.d.ts +70 -70
- package/package.json +1 -1
|
@@ -4,11 +4,13 @@ export function __wbg_set_wasm(val) {
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const heap = new Array(128).fill(undefined);
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
heap.push(undefined, null, true, false);
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
function getObject(idx) { return heap[idx]; }
|
|
12
|
+
|
|
13
|
+
let WASM_VECTOR_LEN = 0;
|
|
12
14
|
|
|
13
15
|
let cachedUint8ArrayMemory0 = null;
|
|
14
16
|
|
|
@@ -19,42 +21,6 @@ function getUint8ArrayMemory0() {
|
|
|
19
21
|
return cachedUint8ArrayMemory0;
|
|
20
22
|
}
|
|
21
23
|
|
|
22
|
-
function getStringFromWasm0(ptr, len) {
|
|
23
|
-
ptr = ptr >>> 0;
|
|
24
|
-
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const heap = new Array(128).fill(undefined);
|
|
28
|
-
|
|
29
|
-
heap.push(undefined, null, true, false);
|
|
30
|
-
|
|
31
|
-
let heap_next = heap.length;
|
|
32
|
-
|
|
33
|
-
function addHeapObject(obj) {
|
|
34
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
35
|
-
const idx = heap_next;
|
|
36
|
-
heap_next = heap[idx];
|
|
37
|
-
|
|
38
|
-
heap[idx] = obj;
|
|
39
|
-
return idx;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function getObject(idx) { return heap[idx]; }
|
|
43
|
-
|
|
44
|
-
function dropObject(idx) {
|
|
45
|
-
if (idx < 132) return;
|
|
46
|
-
heap[idx] = heap_next;
|
|
47
|
-
heap_next = idx;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function takeObject(idx) {
|
|
51
|
-
const ret = getObject(idx);
|
|
52
|
-
dropObject(idx);
|
|
53
|
-
return ret;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
let WASM_VECTOR_LEN = 0;
|
|
57
|
-
|
|
58
24
|
const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;
|
|
59
25
|
|
|
60
26
|
let cachedTextEncoder = new lTextEncoder('utf-8');
|
|
@@ -111,10 +77,6 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
111
77
|
return ptr;
|
|
112
78
|
}
|
|
113
79
|
|
|
114
|
-
function isLikeNone(x) {
|
|
115
|
-
return x === undefined || x === null;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
80
|
let cachedDataViewMemory0 = null;
|
|
119
81
|
|
|
120
82
|
function getDataViewMemory0() {
|
|
@@ -124,6 +86,41 @@ function getDataViewMemory0() {
|
|
|
124
86
|
return cachedDataViewMemory0;
|
|
125
87
|
}
|
|
126
88
|
|
|
89
|
+
let heap_next = heap.length;
|
|
90
|
+
|
|
91
|
+
function addHeapObject(obj) {
|
|
92
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
93
|
+
const idx = heap_next;
|
|
94
|
+
heap_next = heap[idx];
|
|
95
|
+
|
|
96
|
+
heap[idx] = obj;
|
|
97
|
+
return idx;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function handleError(f, args) {
|
|
101
|
+
try {
|
|
102
|
+
return f.apply(this, args);
|
|
103
|
+
} catch (e) {
|
|
104
|
+
wasm.__wbindgen_export_2(addHeapObject(e));
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function dropObject(idx) {
|
|
109
|
+
if (idx < 132) return;
|
|
110
|
+
heap[idx] = heap_next;
|
|
111
|
+
heap_next = idx;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function takeObject(idx) {
|
|
115
|
+
const ret = getObject(idx);
|
|
116
|
+
dropObject(idx);
|
|
117
|
+
return ret;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function isLikeNone(x) {
|
|
121
|
+
return x === undefined || x === null;
|
|
122
|
+
}
|
|
123
|
+
|
|
127
124
|
function debugString(val) {
|
|
128
125
|
// primitive types
|
|
129
126
|
const type = typeof val;
|
|
@@ -165,7 +162,7 @@ function debugString(val) {
|
|
|
165
162
|
// Test for built-in
|
|
166
163
|
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
167
164
|
let className;
|
|
168
|
-
if (builtInMatches.length > 1) {
|
|
165
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
169
166
|
className = builtInMatches[1];
|
|
170
167
|
} else {
|
|
171
168
|
// Failed to match the standard '[object ClassName]'
|
|
@@ -189,382 +186,120 @@ function debugString(val) {
|
|
|
189
186
|
return className;
|
|
190
187
|
}
|
|
191
188
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
189
|
+
const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
|
|
190
|
+
|
|
191
|
+
let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
192
|
+
|
|
193
|
+
cachedTextDecoder.decode();
|
|
194
|
+
|
|
195
|
+
function getStringFromWasm0(ptr, len) {
|
|
196
|
+
ptr = ptr >>> 0;
|
|
197
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
198
198
|
}
|
|
199
199
|
/**
|
|
200
|
-
*
|
|
200
|
+
* Check if a position is in range.
|
|
201
|
+
* When a position is in range it is earning fees and rewards
|
|
201
202
|
*
|
|
202
203
|
* # Parameters
|
|
203
|
-
* - `
|
|
204
|
-
* - `
|
|
204
|
+
* - `sqrt_price` - A u128 integer representing the sqrt price of the pool
|
|
205
|
+
* - `tick_index_1` - A i32 integer representing the first tick index of the position
|
|
206
|
+
* - `tick_index_2` - A i32 integer representing the second tick index of the position
|
|
205
207
|
*
|
|
206
208
|
* # Returns
|
|
207
|
-
* - A
|
|
209
|
+
* - A boolean value indicating if the position is in range
|
|
208
210
|
*/
|
|
209
|
-
export function
|
|
210
|
-
const ret = wasm.
|
|
211
|
-
return ret;
|
|
211
|
+
export function isPositionInRange(current_sqrt_price, tick_index_1, tick_index_2) {
|
|
212
|
+
const ret = wasm.isPositionInRange(addHeapObject(current_sqrt_price), tick_index_1, tick_index_2);
|
|
213
|
+
return ret !== 0;
|
|
212
214
|
}
|
|
213
215
|
|
|
214
216
|
/**
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
+
* Calculate the status of a position
|
|
218
|
+
* The status can be one of three values:
|
|
219
|
+
* - InRange: The position is in range
|
|
220
|
+
* - BelowRange: The position is below the range
|
|
221
|
+
* - AboveRange: The position is above the range
|
|
217
222
|
*
|
|
218
223
|
* # Parameters
|
|
219
|
-
* - `
|
|
224
|
+
* - `sqrt_price` - A u128 integer representing the sqrt price of the pool
|
|
225
|
+
* - `tick_index_1` - A i32 integer representing the first tick index of the position
|
|
226
|
+
* - `tick_index_2` - A i32 integer representing the second tick index of the position
|
|
220
227
|
*
|
|
221
228
|
* # Returns
|
|
222
|
-
* -
|
|
229
|
+
* - A PositionStatus enum value indicating the status of the position
|
|
223
230
|
*/
|
|
224
|
-
export function
|
|
225
|
-
const ret = wasm.
|
|
231
|
+
export function positionStatus(current_sqrt_price, tick_index_1, tick_index_2) {
|
|
232
|
+
const ret = wasm.positionStatus(addHeapObject(current_sqrt_price), tick_index_1, tick_index_2);
|
|
226
233
|
return takeObject(ret);
|
|
227
234
|
}
|
|
228
235
|
|
|
229
236
|
/**
|
|
230
|
-
*
|
|
231
|
-
* if tick is within the bounds of {max, min} tick-index.
|
|
237
|
+
* Calculate the token_a / token_b ratio of a (ficticious) position
|
|
232
238
|
*
|
|
233
239
|
* # Parameters
|
|
234
|
-
* - `sqrt_price` - A u128 integer representing the sqrt price
|
|
240
|
+
* - `sqrt_price` - A u128 integer representing the sqrt price of the pool
|
|
241
|
+
* - `tick_index_1` - A i32 integer representing the first tick index of the position
|
|
242
|
+
* - `tick_index_2` - A i32 integer representing the second tick index of the position
|
|
235
243
|
*
|
|
236
244
|
* # Returns
|
|
237
|
-
* -
|
|
245
|
+
* - A PositionRatio struct containing the ratio of token_a and token_b
|
|
238
246
|
*/
|
|
239
|
-
export function
|
|
240
|
-
const ret = wasm.
|
|
241
|
-
return ret;
|
|
247
|
+
export function positionRatio(current_sqrt_price, tick_index_1, tick_index_2) {
|
|
248
|
+
const ret = wasm.positionRatio(addHeapObject(current_sqrt_price), tick_index_1, tick_index_2);
|
|
249
|
+
return takeObject(ret);
|
|
242
250
|
}
|
|
243
251
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
*
|
|
248
|
-
* # Parameters
|
|
249
|
-
* - `tick_index` - A i32 integer representing the tick integer
|
|
250
|
-
* - `tick_spacing` - A i32 integer representing the tick spacing
|
|
251
|
-
* - `round_up` - A boolean value indicating if the supplied tick index should be rounded up. None will round to the nearest.
|
|
252
|
-
*
|
|
253
|
-
* # Returns
|
|
254
|
-
* - A i32 integer representing the previous initializable tick index
|
|
255
|
-
*/
|
|
256
|
-
export function getInitializableTickIndex(tick_index, tick_spacing, round_up) {
|
|
257
|
-
const ret = wasm.getInitializableTickIndex(tick_index, tick_spacing, isLikeNone(round_up) ? 0xFFFFFF : round_up ? 1 : 0);
|
|
258
|
-
return ret;
|
|
252
|
+
export function _POSITION_BUNDLE_SIZE() {
|
|
253
|
+
const ret = wasm._POSITION_BUNDLE_SIZE();
|
|
254
|
+
return ret >>> 0;
|
|
259
255
|
}
|
|
260
256
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
export function getPrevInitializableTickIndex(tick_index, tick_spacing) {
|
|
272
|
-
const ret = wasm.getPrevInitializableTickIndex(tick_index, tick_spacing);
|
|
273
|
-
return ret;
|
|
257
|
+
export function _TICK_ARRAY_NOT_EVENLY_SPACED() {
|
|
258
|
+
try {
|
|
259
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
260
|
+
wasm._TICK_ARRAY_NOT_EVENLY_SPACED(retptr);
|
|
261
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
262
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
263
|
+
return getStringFromWasm0(r0, r1);
|
|
264
|
+
} finally {
|
|
265
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
266
|
+
}
|
|
274
267
|
}
|
|
275
268
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
export function getNextInitializableTickIndex(tick_index, tick_spacing) {
|
|
287
|
-
const ret = wasm.getNextInitializableTickIndex(tick_index, tick_spacing);
|
|
288
|
-
return ret;
|
|
269
|
+
export function _TICK_INDEX_OUT_OF_BOUNDS() {
|
|
270
|
+
try {
|
|
271
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
272
|
+
wasm._TICK_INDEX_OUT_OF_BOUNDS(retptr);
|
|
273
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
274
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
275
|
+
return getStringFromWasm0(r0, r1);
|
|
276
|
+
} finally {
|
|
277
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
278
|
+
}
|
|
289
279
|
}
|
|
290
280
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
*
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
const ret = wasm.isTickIndexInBounds(tick_index);
|
|
302
|
-
return ret !== 0;
|
|
281
|
+
export function _INVALID_TICK_INDEX() {
|
|
282
|
+
try {
|
|
283
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
284
|
+
wasm._INVALID_TICK_INDEX(retptr);
|
|
285
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
286
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
287
|
+
return getStringFromWasm0(r0, r1);
|
|
288
|
+
} finally {
|
|
289
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
290
|
+
}
|
|
303
291
|
}
|
|
304
292
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
*
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
*/
|
|
316
|
-
export function isTickInitializable(tick_index, tick_spacing) {
|
|
317
|
-
const ret = wasm.isTickInitializable(tick_index, tick_spacing);
|
|
318
|
-
return ret !== 0;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
/**
|
|
322
|
-
* Get the tick index for the inverse of the price that this tick represents.
|
|
323
|
-
* Eg: Consider tick i where Pb/Pa = 1.0001 ^ i
|
|
324
|
-
* inverse of this, i.e. Pa/Pb = 1 / (1.0001 ^ i) = 1.0001^-i
|
|
325
|
-
*
|
|
326
|
-
* # Parameters
|
|
327
|
-
* - `tick_index` - A i32 integer representing the tick integer
|
|
328
|
-
*
|
|
329
|
-
* # Returns
|
|
330
|
-
* - A i32 integer representing the tick index for the inverse of the price
|
|
331
|
-
*/
|
|
332
|
-
export function invertTickIndex(tick_index) {
|
|
333
|
-
const ret = wasm.invertTickIndex(tick_index);
|
|
334
|
-
return ret;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* Get the sqrt price for the inverse of the price that this tick represents.
|
|
339
|
-
* Because converting to a tick index and then back to a sqrt price is lossy,
|
|
340
|
-
* this function is clamped to the nearest tick index.
|
|
341
|
-
*
|
|
342
|
-
* # Parameters
|
|
343
|
-
* - `sqrt_price` - A u128 integer representing the sqrt price
|
|
344
|
-
*
|
|
345
|
-
* # Returns
|
|
346
|
-
* - A u128 integer representing the sqrt price for the inverse of the price
|
|
347
|
-
*/
|
|
348
|
-
export function invertSqrtPrice(sqrt_price) {
|
|
349
|
-
const ret = wasm.invertSqrtPrice(addHeapObject(sqrt_price));
|
|
350
|
-
return takeObject(ret);
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
/**
|
|
354
|
-
* Get the minimum and maximum tick index that can be initialized.
|
|
355
|
-
*
|
|
356
|
-
* # Parameters
|
|
357
|
-
* - `tick_spacing` - A i32 integer representing the tick spacing
|
|
358
|
-
*
|
|
359
|
-
* # Returns
|
|
360
|
-
* - A TickRange struct containing the lower and upper tick index
|
|
361
|
-
*/
|
|
362
|
-
export function getFullRangeTickIndexes(tick_spacing) {
|
|
363
|
-
const ret = wasm.getFullRangeTickIndexes(tick_spacing);
|
|
364
|
-
return takeObject(ret);
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
/**
|
|
368
|
-
* Order tick indexes in ascending order.
|
|
369
|
-
* If the lower tick index is greater than the upper tick index, the indexes are swapped.
|
|
370
|
-
* This is useful for ensuring that the lower tick index is always less than the upper tick index.
|
|
371
|
-
*
|
|
372
|
-
* # Parameters
|
|
373
|
-
* - `tick_index_1` - A i32 integer representing the first tick index
|
|
374
|
-
* - `tick_index_2` - A i32 integer representing the second tick index
|
|
375
|
-
*
|
|
376
|
-
* # Returns
|
|
377
|
-
* - A TickRange struct containing the lower and upper tick index
|
|
378
|
-
*/
|
|
379
|
-
export function orderTickIndexes(tick_index_1, tick_index_2) {
|
|
380
|
-
const ret = wasm.orderTickIndexes(tick_index_1, tick_index_2);
|
|
381
|
-
return takeObject(ret);
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
/**
|
|
385
|
-
* Check if a whirlpool is a full-range only pool.
|
|
386
|
-
*
|
|
387
|
-
* # Parameters
|
|
388
|
-
* - `tick_spacing` - A u16 integer representing the tick spacing
|
|
389
|
-
*
|
|
390
|
-
* # Returns
|
|
391
|
-
* - A boolean value indicating if the whirlpool is a full-range only pool
|
|
392
|
-
*/
|
|
393
|
-
export function isFullRangeOnly(tick_spacing) {
|
|
394
|
-
const ret = wasm.isFullRangeOnly(tick_spacing);
|
|
395
|
-
return ret !== 0;
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
/**
|
|
399
|
-
* Get the index of a tick in a tick array.
|
|
400
|
-
*
|
|
401
|
-
* # Parameters
|
|
402
|
-
* - `tick_index` - A i32 integer representing the tick index
|
|
403
|
-
* - `tick_array_start_index` - A i32 integer representing the start tick index of the tick array
|
|
404
|
-
* - `tick_spacing` - A u16 integer representing the tick spacing
|
|
405
|
-
*
|
|
406
|
-
* # Returns
|
|
407
|
-
* - A u32 integer representing the tick index in the tick array
|
|
408
|
-
*/
|
|
409
|
-
export function getTickIndexInArray(tick_index, tick_array_start_index, tick_spacing) {
|
|
410
|
-
try {
|
|
411
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
412
|
-
wasm.getTickIndexInArray(retptr, tick_index, tick_array_start_index, tick_spacing);
|
|
413
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
414
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
415
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
416
|
-
if (r2) {
|
|
417
|
-
throw takeObject(r1);
|
|
418
|
-
}
|
|
419
|
-
return r0 >>> 0;
|
|
420
|
-
} finally {
|
|
421
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
export function _POSITION_BUNDLE_SIZE() {
|
|
426
|
-
const ret = wasm._POSITION_BUNDLE_SIZE();
|
|
427
|
-
return ret >>> 0;
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
export function _NUM_REWARDS() {
|
|
431
|
-
const ret = wasm._NUM_REWARDS();
|
|
432
|
-
return ret >>> 0;
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
export function _FEE_RATE_DENOMINATOR() {
|
|
436
|
-
const ret = wasm._FEE_RATE_DENOMINATOR();
|
|
437
|
-
return ret >>> 0;
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
export function _TICK_ARRAY_SIZE() {
|
|
441
|
-
const ret = wasm._TICK_ARRAY_SIZE();
|
|
442
|
-
return ret >>> 0;
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
export function _FULL_RANGE_ONLY_TICK_SPACING_THRESHOLD() {
|
|
446
|
-
const ret = wasm._FULL_RANGE_ONLY_TICK_SPACING_THRESHOLD();
|
|
447
|
-
return ret;
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
export function _MIN_TICK_INDEX() {
|
|
451
|
-
const ret = wasm._MIN_TICK_INDEX();
|
|
452
|
-
return ret;
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
export function _MAX_TICK_INDEX() {
|
|
456
|
-
const ret = wasm._MAX_TICK_INDEX();
|
|
457
|
-
return ret;
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
461
|
-
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
462
|
-
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
463
|
-
WASM_VECTOR_LEN = arg.length;
|
|
464
|
-
return ptr;
|
|
465
|
-
}
|
|
466
|
-
/**
|
|
467
|
-
* Get the first unoccupied position in a bundle
|
|
468
|
-
*
|
|
469
|
-
* # Arguments
|
|
470
|
-
* * `bundle` - The bundle to check
|
|
471
|
-
*
|
|
472
|
-
* # Returns
|
|
473
|
-
* * `u32` - The first unoccupied position (None if full)
|
|
474
|
-
*/
|
|
475
|
-
export function firstUnoccupiedPositionInBundle(bitmap) {
|
|
476
|
-
try {
|
|
477
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
478
|
-
const ptr0 = passArray8ToWasm0(bitmap, wasm.__wbindgen_export_0);
|
|
479
|
-
const len0 = WASM_VECTOR_LEN;
|
|
480
|
-
wasm.firstUnoccupiedPositionInBundle(retptr, ptr0, len0);
|
|
481
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
482
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
483
|
-
return r0 === 0 ? undefined : r1 >>> 0;
|
|
484
|
-
} finally {
|
|
485
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
/**
|
|
490
|
-
* Check whether a position bundle is full
|
|
491
|
-
* A position bundle can contain 256 positions
|
|
492
|
-
*
|
|
493
|
-
* # Arguments
|
|
494
|
-
* * `bundle` - The bundle to check
|
|
495
|
-
*
|
|
496
|
-
* # Returns
|
|
497
|
-
* * `bool` - Whether the bundle is full
|
|
498
|
-
*/
|
|
499
|
-
export function isPositionBundleFull(bitmap) {
|
|
500
|
-
const ptr0 = passArray8ToWasm0(bitmap, wasm.__wbindgen_export_0);
|
|
501
|
-
const len0 = WASM_VECTOR_LEN;
|
|
502
|
-
const ret = wasm.isPositionBundleFull(ptr0, len0);
|
|
503
|
-
return ret !== 0;
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
/**
|
|
507
|
-
* Check whether a position bundle is empty
|
|
508
|
-
*
|
|
509
|
-
* # Arguments
|
|
510
|
-
* * `bundle` - The bundle to check
|
|
511
|
-
*
|
|
512
|
-
* # Returns
|
|
513
|
-
* * `bool` - Whether the bundle is empty
|
|
514
|
-
*/
|
|
515
|
-
export function isPositionBundleEmpty(bitmap) {
|
|
516
|
-
const ptr0 = passArray8ToWasm0(bitmap, wasm.__wbindgen_export_0);
|
|
517
|
-
const len0 = WASM_VECTOR_LEN;
|
|
518
|
-
const ret = wasm.isPositionBundleEmpty(ptr0, len0);
|
|
519
|
-
return ret !== 0;
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
export function _TICK_ARRAY_NOT_EVENLY_SPACED() {
|
|
523
|
-
try {
|
|
524
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
525
|
-
wasm._TICK_ARRAY_NOT_EVENLY_SPACED(retptr);
|
|
526
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
527
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
528
|
-
return getStringFromWasm0(r0, r1);
|
|
529
|
-
} finally {
|
|
530
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
export function _TICK_INDEX_OUT_OF_BOUNDS() {
|
|
535
|
-
try {
|
|
536
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
537
|
-
wasm._TICK_INDEX_OUT_OF_BOUNDS(retptr);
|
|
538
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
539
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
540
|
-
return getStringFromWasm0(r0, r1);
|
|
541
|
-
} finally {
|
|
542
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
export function _INVALID_TICK_INDEX() {
|
|
547
|
-
try {
|
|
548
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
549
|
-
wasm._INVALID_TICK_INDEX(retptr);
|
|
550
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
551
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
552
|
-
return getStringFromWasm0(r0, r1);
|
|
553
|
-
} finally {
|
|
554
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
export function _ARITHMETIC_OVERFLOW() {
|
|
559
|
-
try {
|
|
560
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
561
|
-
wasm._ARITHMETIC_OVERFLOW(retptr);
|
|
562
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
563
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
564
|
-
return getStringFromWasm0(r0, r1);
|
|
565
|
-
} finally {
|
|
566
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
567
|
-
}
|
|
293
|
+
export function _ARITHMETIC_OVERFLOW() {
|
|
294
|
+
try {
|
|
295
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
296
|
+
wasm._ARITHMETIC_OVERFLOW(retptr);
|
|
297
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
298
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
299
|
+
return getStringFromWasm0(r0, r1);
|
|
300
|
+
} finally {
|
|
301
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
302
|
+
}
|
|
568
303
|
}
|
|
569
304
|
|
|
570
305
|
export function _AMOUNT_EXCEEDS_MAX_U64() {
|
|
@@ -687,59 +422,317 @@ export function _TICK_INDEX_NOT_IN_ARRAY() {
|
|
|
687
422
|
}
|
|
688
423
|
}
|
|
689
424
|
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
425
|
+
export function _NUM_REWARDS() {
|
|
426
|
+
const ret = wasm._NUM_REWARDS();
|
|
427
|
+
return ret >>> 0;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
export function _FEE_RATE_DENOMINATOR() {
|
|
431
|
+
const ret = wasm._FEE_RATE_DENOMINATOR();
|
|
432
|
+
return ret >>> 0;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
export function _TICK_ARRAY_SIZE() {
|
|
436
|
+
const ret = wasm._TICK_ARRAY_SIZE();
|
|
437
|
+
return ret >>> 0;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
export function _FULL_RANGE_ONLY_TICK_SPACING_THRESHOLD() {
|
|
441
|
+
const ret = wasm._FULL_RANGE_ONLY_TICK_SPACING_THRESHOLD();
|
|
442
|
+
return ret;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
export function _MIN_TICK_INDEX() {
|
|
446
|
+
const ret = wasm._MIN_TICK_INDEX();
|
|
447
|
+
return ret;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
export function _MAX_TICK_INDEX() {
|
|
451
|
+
const ret = wasm._MAX_TICK_INDEX();
|
|
452
|
+
return ret;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
456
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
457
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
458
|
+
WASM_VECTOR_LEN = arg.length;
|
|
459
|
+
return ptr;
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Get the first unoccupied position in a bundle
|
|
463
|
+
*
|
|
464
|
+
* # Arguments
|
|
465
|
+
* * `bundle` - The bundle to check
|
|
466
|
+
*
|
|
467
|
+
* # Returns
|
|
468
|
+
* * `u32` - The first unoccupied position (None if full)
|
|
701
469
|
*/
|
|
702
|
-
export function
|
|
703
|
-
const
|
|
470
|
+
export function firstUnoccupiedPositionInBundle(bitmap) {
|
|
471
|
+
const ptr0 = passArray8ToWasm0(bitmap, wasm.__wbindgen_export_0);
|
|
472
|
+
const len0 = WASM_VECTOR_LEN;
|
|
473
|
+
const ret = wasm.firstUnoccupiedPositionInBundle(ptr0, len0);
|
|
474
|
+
return ret === 0x100000001 ? undefined : ret;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* Check whether a position bundle is full
|
|
479
|
+
* A position bundle can contain 256 positions
|
|
480
|
+
*
|
|
481
|
+
* # Arguments
|
|
482
|
+
* * `bundle` - The bundle to check
|
|
483
|
+
*
|
|
484
|
+
* # Returns
|
|
485
|
+
* * `bool` - Whether the bundle is full
|
|
486
|
+
*/
|
|
487
|
+
export function isPositionBundleFull(bitmap) {
|
|
488
|
+
const ptr0 = passArray8ToWasm0(bitmap, wasm.__wbindgen_export_0);
|
|
489
|
+
const len0 = WASM_VECTOR_LEN;
|
|
490
|
+
const ret = wasm.isPositionBundleFull(ptr0, len0);
|
|
704
491
|
return ret !== 0;
|
|
705
492
|
}
|
|
706
493
|
|
|
707
494
|
/**
|
|
708
|
-
*
|
|
709
|
-
*
|
|
710
|
-
*
|
|
711
|
-
* -
|
|
712
|
-
*
|
|
495
|
+
* Check whether a position bundle is empty
|
|
496
|
+
*
|
|
497
|
+
* # Arguments
|
|
498
|
+
* * `bundle` - The bundle to check
|
|
499
|
+
*
|
|
500
|
+
* # Returns
|
|
501
|
+
* * `bool` - Whether the bundle is empty
|
|
502
|
+
*/
|
|
503
|
+
export function isPositionBundleEmpty(bitmap) {
|
|
504
|
+
const ptr0 = passArray8ToWasm0(bitmap, wasm.__wbindgen_export_0);
|
|
505
|
+
const len0 = WASM_VECTOR_LEN;
|
|
506
|
+
const ret = wasm.isPositionBundleEmpty(ptr0, len0);
|
|
507
|
+
return ret !== 0;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* Get the first tick index in the tick array that contains the specified tick index.
|
|
713
512
|
*
|
|
714
513
|
* # Parameters
|
|
715
|
-
* - `
|
|
716
|
-
* - `
|
|
717
|
-
* - `tick_index_2` - A i32 integer representing the second tick index of the position
|
|
514
|
+
* - `tick_index` - A i32 integer representing the tick integer
|
|
515
|
+
* - `tick_spacing` - A i32 integer representing the tick spacing
|
|
718
516
|
*
|
|
719
517
|
* # Returns
|
|
720
|
-
* - A
|
|
518
|
+
* - A i32 integer representing the first tick index in the tick array
|
|
721
519
|
*/
|
|
722
|
-
export function
|
|
723
|
-
const ret = wasm.
|
|
520
|
+
export function getTickArrayStartTickIndex(tick_index, tick_spacing) {
|
|
521
|
+
const ret = wasm.getTickArrayStartTickIndex(tick_index, tick_spacing);
|
|
522
|
+
return ret;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* Derive the sqrt-price from a tick index. The precision of this method is only guarranted
|
|
527
|
+
* if tick is within the bounds of {max, min} tick-index.
|
|
528
|
+
*
|
|
529
|
+
* # Parameters
|
|
530
|
+
* - `tick_index` - A i32 integer representing the tick integer
|
|
531
|
+
*
|
|
532
|
+
* # Returns
|
|
533
|
+
* - `Ok`: A u128 Q32.64 representing the sqrt_price
|
|
534
|
+
*/
|
|
535
|
+
export function tickIndexToSqrtPrice(tick_index) {
|
|
536
|
+
const ret = wasm.tickIndexToSqrtPrice(tick_index);
|
|
724
537
|
return takeObject(ret);
|
|
725
538
|
}
|
|
726
539
|
|
|
727
540
|
/**
|
|
728
|
-
*
|
|
541
|
+
* Derive the tick index from a sqrt price. The precision of this method is only guarranted
|
|
542
|
+
* if tick is within the bounds of {max, min} tick-index.
|
|
729
543
|
*
|
|
730
544
|
* # Parameters
|
|
731
|
-
* - `sqrt_price` - A u128 integer representing the sqrt price
|
|
732
|
-
* - `tick_index_1` - A i32 integer representing the first tick index of the position
|
|
733
|
-
* - `tick_index_2` - A i32 integer representing the second tick index of the position
|
|
545
|
+
* - `sqrt_price` - A u128 integer representing the sqrt price
|
|
734
546
|
*
|
|
735
547
|
* # Returns
|
|
736
|
-
* - A
|
|
548
|
+
* - `Ok`: A i32 integer representing the tick integer
|
|
737
549
|
*/
|
|
738
|
-
export function
|
|
739
|
-
const ret = wasm.
|
|
550
|
+
export function sqrtPriceToTickIndex(sqrt_price) {
|
|
551
|
+
const ret = wasm.sqrtPriceToTickIndex(addHeapObject(sqrt_price));
|
|
552
|
+
return ret;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* Get the initializable tick index.
|
|
557
|
+
* If the tick index is already initializable, it is returned as is.
|
|
558
|
+
*
|
|
559
|
+
* # Parameters
|
|
560
|
+
* - `tick_index` - A i32 integer representing the tick integer
|
|
561
|
+
* - `tick_spacing` - A i32 integer representing the tick spacing
|
|
562
|
+
* - `round_up` - A boolean value indicating if the supplied tick index should be rounded up. None will round to the nearest.
|
|
563
|
+
*
|
|
564
|
+
* # Returns
|
|
565
|
+
* - A i32 integer representing the previous initializable tick index
|
|
566
|
+
*/
|
|
567
|
+
export function getInitializableTickIndex(tick_index, tick_spacing, round_up) {
|
|
568
|
+
const ret = wasm.getInitializableTickIndex(tick_index, tick_spacing, isLikeNone(round_up) ? 0xFFFFFF : round_up ? 1 : 0);
|
|
569
|
+
return ret;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
/**
|
|
573
|
+
* Get the previous initializable tick index.
|
|
574
|
+
*
|
|
575
|
+
* # Parameters
|
|
576
|
+
* - `tick_index` - A i32 integer representing the tick integer
|
|
577
|
+
* - `tick_spacing` - A i32 integer representing the tick spacing
|
|
578
|
+
*
|
|
579
|
+
* # Returns
|
|
580
|
+
* - A i32 integer representing the previous initializable tick index
|
|
581
|
+
*/
|
|
582
|
+
export function getPrevInitializableTickIndex(tick_index, tick_spacing) {
|
|
583
|
+
const ret = wasm.getPrevInitializableTickIndex(tick_index, tick_spacing);
|
|
584
|
+
return ret;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
/**
|
|
588
|
+
* Get the next initializable tick index.
|
|
589
|
+
*
|
|
590
|
+
* # Parameters
|
|
591
|
+
* - `tick_index` - A i32 integer representing the tick integer
|
|
592
|
+
* - `tick_spacing` - A i32 integer representing the tick spacing
|
|
593
|
+
*
|
|
594
|
+
* # Returns
|
|
595
|
+
* - A i32 integer representing the next initializable tick index
|
|
596
|
+
*/
|
|
597
|
+
export function getNextInitializableTickIndex(tick_index, tick_spacing) {
|
|
598
|
+
const ret = wasm.getNextInitializableTickIndex(tick_index, tick_spacing);
|
|
599
|
+
return ret;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* Check if a tick is in-bounds.
|
|
604
|
+
*
|
|
605
|
+
* # Parameters
|
|
606
|
+
* - `tick_index` - A i32 integer representing the tick integer
|
|
607
|
+
*
|
|
608
|
+
* # Returns
|
|
609
|
+
* - A boolean value indicating if the tick is in-bounds
|
|
610
|
+
*/
|
|
611
|
+
export function isTickIndexInBounds(tick_index) {
|
|
612
|
+
const ret = wasm.isTickIndexInBounds(tick_index);
|
|
613
|
+
return ret !== 0;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* Check if a tick is initializable.
|
|
618
|
+
* A tick is initializable if it is divisible by the tick spacing.
|
|
619
|
+
*
|
|
620
|
+
* # Parameters
|
|
621
|
+
* - `tick_index` - A i32 integer representing the tick integer
|
|
622
|
+
* - `tick_spacing` - A i32 integer representing the tick spacing
|
|
623
|
+
*
|
|
624
|
+
* # Returns
|
|
625
|
+
* - A boolean value indicating if the tick is initializable
|
|
626
|
+
*/
|
|
627
|
+
export function isTickInitializable(tick_index, tick_spacing) {
|
|
628
|
+
const ret = wasm.isTickInitializable(tick_index, tick_spacing);
|
|
629
|
+
return ret !== 0;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* Get the tick index for the inverse of the price that this tick represents.
|
|
634
|
+
* Eg: Consider tick i where Pb/Pa = 1.0001 ^ i
|
|
635
|
+
* inverse of this, i.e. Pa/Pb = 1 / (1.0001 ^ i) = 1.0001^-i
|
|
636
|
+
*
|
|
637
|
+
* # Parameters
|
|
638
|
+
* - `tick_index` - A i32 integer representing the tick integer
|
|
639
|
+
*
|
|
640
|
+
* # Returns
|
|
641
|
+
* - A i32 integer representing the tick index for the inverse of the price
|
|
642
|
+
*/
|
|
643
|
+
export function invertTickIndex(tick_index) {
|
|
644
|
+
const ret = wasm.invertTickIndex(tick_index);
|
|
645
|
+
return ret;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
/**
|
|
649
|
+
* Get the sqrt price for the inverse of the price that this tick represents.
|
|
650
|
+
* Because converting to a tick index and then back to a sqrt price is lossy,
|
|
651
|
+
* this function is clamped to the nearest tick index.
|
|
652
|
+
*
|
|
653
|
+
* # Parameters
|
|
654
|
+
* - `sqrt_price` - A u128 integer representing the sqrt price
|
|
655
|
+
*
|
|
656
|
+
* # Returns
|
|
657
|
+
* - A u128 integer representing the sqrt price for the inverse of the price
|
|
658
|
+
*/
|
|
659
|
+
export function invertSqrtPrice(sqrt_price) {
|
|
660
|
+
const ret = wasm.invertSqrtPrice(addHeapObject(sqrt_price));
|
|
661
|
+
return takeObject(ret);
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
/**
|
|
665
|
+
* Get the minimum and maximum tick index that can be initialized.
|
|
666
|
+
*
|
|
667
|
+
* # Parameters
|
|
668
|
+
* - `tick_spacing` - A i32 integer representing the tick spacing
|
|
669
|
+
*
|
|
670
|
+
* # Returns
|
|
671
|
+
* - A TickRange struct containing the lower and upper tick index
|
|
672
|
+
*/
|
|
673
|
+
export function getFullRangeTickIndexes(tick_spacing) {
|
|
674
|
+
const ret = wasm.getFullRangeTickIndexes(tick_spacing);
|
|
740
675
|
return takeObject(ret);
|
|
741
676
|
}
|
|
742
677
|
|
|
678
|
+
/**
|
|
679
|
+
* Order tick indexes in ascending order.
|
|
680
|
+
* If the lower tick index is greater than the upper tick index, the indexes are swapped.
|
|
681
|
+
* This is useful for ensuring that the lower tick index is always less than the upper tick index.
|
|
682
|
+
*
|
|
683
|
+
* # Parameters
|
|
684
|
+
* - `tick_index_1` - A i32 integer representing the first tick index
|
|
685
|
+
* - `tick_index_2` - A i32 integer representing the second tick index
|
|
686
|
+
*
|
|
687
|
+
* # Returns
|
|
688
|
+
* - A TickRange struct containing the lower and upper tick index
|
|
689
|
+
*/
|
|
690
|
+
export function orderTickIndexes(tick_index_1, tick_index_2) {
|
|
691
|
+
const ret = wasm.orderTickIndexes(tick_index_1, tick_index_2);
|
|
692
|
+
return takeObject(ret);
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
/**
|
|
696
|
+
* Check if a whirlpool is a full-range only pool.
|
|
697
|
+
*
|
|
698
|
+
* # Parameters
|
|
699
|
+
* - `tick_spacing` - A u16 integer representing the tick spacing
|
|
700
|
+
*
|
|
701
|
+
* # Returns
|
|
702
|
+
* - A boolean value indicating if the whirlpool is a full-range only pool
|
|
703
|
+
*/
|
|
704
|
+
export function isFullRangeOnly(tick_spacing) {
|
|
705
|
+
const ret = wasm.isFullRangeOnly(tick_spacing);
|
|
706
|
+
return ret !== 0;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
/**
|
|
710
|
+
* Get the index of a tick in a tick array.
|
|
711
|
+
*
|
|
712
|
+
* # Parameters
|
|
713
|
+
* - `tick_index` - A i32 integer representing the tick index
|
|
714
|
+
* - `tick_array_start_index` - A i32 integer representing the start tick index of the tick array
|
|
715
|
+
* - `tick_spacing` - A u16 integer representing the tick spacing
|
|
716
|
+
*
|
|
717
|
+
* # Returns
|
|
718
|
+
* - A u32 integer representing the tick index in the tick array
|
|
719
|
+
*/
|
|
720
|
+
export function getTickIndexInArray(tick_index, tick_array_start_index, tick_spacing) {
|
|
721
|
+
try {
|
|
722
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
723
|
+
wasm.getTickIndexInArray(retptr, tick_index, tick_array_start_index, tick_spacing);
|
|
724
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
725
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
726
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
727
|
+
if (r2) {
|
|
728
|
+
throw takeObject(r1);
|
|
729
|
+
}
|
|
730
|
+
return r0 >>> 0;
|
|
731
|
+
} finally {
|
|
732
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
|
|
743
736
|
/**
|
|
744
737
|
* Calculate the amount A delta between two sqrt_prices
|
|
745
738
|
*
|
|
@@ -1418,271 +1411,271 @@ export function collectRewardsQuote(whirlpool, position, tick_lower, tick_upper,
|
|
|
1418
1411
|
}
|
|
1419
1412
|
}
|
|
1420
1413
|
|
|
1421
|
-
export function
|
|
1422
|
-
const ret =
|
|
1423
|
-
return addHeapObject(ret);
|
|
1424
|
-
};
|
|
1425
|
-
|
|
1426
|
-
export function __wbindgen_object_drop_ref(arg0) {
|
|
1427
|
-
takeObject(arg0);
|
|
1428
|
-
};
|
|
1429
|
-
|
|
1430
|
-
export function __wbindgen_string_get(arg0, arg1) {
|
|
1431
|
-
const obj = getObject(arg1);
|
|
1432
|
-
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
1433
|
-
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1434
|
-
var len1 = WASM_VECTOR_LEN;
|
|
1435
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1436
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1437
|
-
};
|
|
1438
|
-
|
|
1439
|
-
export function __wbindgen_bigint_get_as_i64(arg0, arg1) {
|
|
1440
|
-
const v = getObject(arg1);
|
|
1441
|
-
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
1442
|
-
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
1443
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
1444
|
-
};
|
|
1445
|
-
|
|
1446
|
-
export function __wbindgen_debug_string(arg0, arg1) {
|
|
1447
|
-
const ret = debugString(getObject(arg1));
|
|
1414
|
+
export function __wbg_String_eecc4a11987127d6(arg0, arg1) {
|
|
1415
|
+
const ret = String(getObject(arg1));
|
|
1448
1416
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1449
1417
|
const len1 = WASM_VECTOR_LEN;
|
|
1450
1418
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1451
1419
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1452
1420
|
};
|
|
1453
1421
|
|
|
1454
|
-
export function
|
|
1455
|
-
|
|
1422
|
+
export function __wbg_buffer_6e1d53ff183194fc(arg0) {
|
|
1423
|
+
const ret = getObject(arg0).buffer;
|
|
1424
|
+
return addHeapObject(ret);
|
|
1456
1425
|
};
|
|
1457
1426
|
|
|
1458
|
-
export function
|
|
1459
|
-
const ret =
|
|
1427
|
+
export function __wbg_call_3114932863209ca6() { return handleError(function (arg0, arg1) {
|
|
1428
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
1460
1429
|
return addHeapObject(ret);
|
|
1430
|
+
}, arguments) };
|
|
1431
|
+
|
|
1432
|
+
export function __wbg_done_adfd3f40364def50(arg0) {
|
|
1433
|
+
const ret = getObject(arg0).done;
|
|
1434
|
+
return ret;
|
|
1461
1435
|
};
|
|
1462
1436
|
|
|
1463
|
-
export function
|
|
1464
|
-
const ret = getObject(arg0);
|
|
1437
|
+
export function __wbg_get_68aa371864aa301a(arg0, arg1) {
|
|
1438
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
1465
1439
|
return addHeapObject(ret);
|
|
1466
1440
|
};
|
|
1467
1441
|
|
|
1468
|
-
export function
|
|
1442
|
+
export function __wbg_get_92a4780a3beb5fe9() { return handleError(function (arg0, arg1) {
|
|
1469
1443
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
1470
1444
|
return addHeapObject(ret);
|
|
1471
1445
|
}, arguments) };
|
|
1472
1446
|
|
|
1473
|
-
export function
|
|
1474
|
-
const ret = getObject(arg0)
|
|
1447
|
+
export function __wbg_getwithrefkey_1dc361bd10053bfe(arg0, arg1) {
|
|
1448
|
+
const ret = getObject(arg0)[getObject(arg1)];
|
|
1475
1449
|
return addHeapObject(ret);
|
|
1476
1450
|
};
|
|
1477
1451
|
|
|
1478
|
-
export function
|
|
1479
|
-
const ret = getObject(arg0)[arg1
|
|
1452
|
+
export function __wbg_getwithrefkey_6550b2c093d2eb18(arg0, arg1) {
|
|
1453
|
+
const ret = getObject(arg0)[getObject(arg1)];
|
|
1480
1454
|
return addHeapObject(ret);
|
|
1481
1455
|
};
|
|
1482
1456
|
|
|
1483
|
-
export function
|
|
1484
|
-
|
|
1457
|
+
export function __wbg_instanceof_ArrayBuffer_435fcead703e2827(arg0) {
|
|
1458
|
+
let result;
|
|
1459
|
+
try {
|
|
1460
|
+
result = getObject(arg0) instanceof ArrayBuffer;
|
|
1461
|
+
} catch (_) {
|
|
1462
|
+
result = false;
|
|
1463
|
+
}
|
|
1464
|
+
const ret = result;
|
|
1485
1465
|
return ret;
|
|
1486
1466
|
};
|
|
1487
1467
|
|
|
1488
|
-
export function
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1468
|
+
export function __wbg_instanceof_Uint8Array_9b67296cab48238f(arg0) {
|
|
1469
|
+
let result;
|
|
1470
|
+
try {
|
|
1471
|
+
result = getObject(arg0) instanceof Uint8Array;
|
|
1472
|
+
} catch (_) {
|
|
1473
|
+
result = false;
|
|
1474
|
+
}
|
|
1475
|
+
const ret = result;
|
|
1476
|
+
return ret;
|
|
1496
1477
|
};
|
|
1497
1478
|
|
|
1498
|
-
export function
|
|
1499
|
-
const ret =
|
|
1479
|
+
export function __wbg_isArray_fcd559a3bcfde1e9(arg0) {
|
|
1480
|
+
const ret = Array.isArray(getObject(arg0));
|
|
1500
1481
|
return ret;
|
|
1501
1482
|
};
|
|
1502
1483
|
|
|
1503
|
-
export function
|
|
1504
|
-
const
|
|
1505
|
-
const ret = typeof(val) === 'object' && val !== null;
|
|
1484
|
+
export function __wbg_isSafeInteger_4de146aa53f6e470(arg0) {
|
|
1485
|
+
const ret = Number.isSafeInteger(getObject(arg0));
|
|
1506
1486
|
return ret;
|
|
1507
1487
|
};
|
|
1508
1488
|
|
|
1509
|
-
export function
|
|
1510
|
-
const ret =
|
|
1489
|
+
export function __wbg_iterator_7a20c20ce22add0f() {
|
|
1490
|
+
const ret = Symbol.iterator;
|
|
1511
1491
|
return addHeapObject(ret);
|
|
1512
1492
|
};
|
|
1513
1493
|
|
|
1514
|
-
export function
|
|
1515
|
-
const ret = getObject(arg0).
|
|
1516
|
-
return
|
|
1517
|
-
}
|
|
1494
|
+
export function __wbg_length_2e63ba34c4121df5(arg0) {
|
|
1495
|
+
const ret = getObject(arg0).length;
|
|
1496
|
+
return ret;
|
|
1497
|
+
};
|
|
1518
1498
|
|
|
1519
|
-
export function
|
|
1520
|
-
const ret = getObject(arg0).
|
|
1499
|
+
export function __wbg_length_e74df4881604f1d9(arg0) {
|
|
1500
|
+
const ret = getObject(arg0).length;
|
|
1521
1501
|
return ret;
|
|
1522
1502
|
};
|
|
1523
1503
|
|
|
1524
|
-
export function
|
|
1525
|
-
const ret =
|
|
1504
|
+
export function __wbg_new_076cac58bb698dd4() {
|
|
1505
|
+
const ret = new Object();
|
|
1526
1506
|
return addHeapObject(ret);
|
|
1527
1507
|
};
|
|
1528
1508
|
|
|
1529
|
-
export function
|
|
1530
|
-
const ret =
|
|
1509
|
+
export function __wbg_new_0c28e72025e00594() {
|
|
1510
|
+
const ret = new Array();
|
|
1531
1511
|
return addHeapObject(ret);
|
|
1532
1512
|
};
|
|
1533
1513
|
|
|
1534
|
-
export function
|
|
1535
|
-
const ret = getObject(arg0)
|
|
1514
|
+
export function __wbg_new_23362fa370a0a372(arg0) {
|
|
1515
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
1516
|
+
return addHeapObject(ret);
|
|
1517
|
+
};
|
|
1518
|
+
|
|
1519
|
+
export function __wbg_next_c591766a7286b02a() { return handleError(function (arg0) {
|
|
1520
|
+
const ret = getObject(arg0).next();
|
|
1536
1521
|
return addHeapObject(ret);
|
|
1537
1522
|
}, arguments) };
|
|
1538
1523
|
|
|
1539
|
-
export function
|
|
1540
|
-
const ret =
|
|
1524
|
+
export function __wbg_next_f387ecc56a94ba00(arg0) {
|
|
1525
|
+
const ret = getObject(arg0).next;
|
|
1541
1526
|
return addHeapObject(ret);
|
|
1542
1527
|
};
|
|
1543
1528
|
|
|
1544
|
-
export function
|
|
1545
|
-
|
|
1546
|
-
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
1547
|
-
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
1548
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
1529
|
+
export function __wbg_set_3807d5f0bfc24aa7(arg0, arg1, arg2) {
|
|
1530
|
+
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
1549
1531
|
};
|
|
1550
1532
|
|
|
1551
|
-
export function
|
|
1552
|
-
|
|
1553
|
-
return ret;
|
|
1533
|
+
export function __wbg_set_7b70226104a82921(arg0, arg1, arg2) {
|
|
1534
|
+
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
1554
1535
|
};
|
|
1555
1536
|
|
|
1556
|
-
export function
|
|
1537
|
+
export function __wbg_set_a1fb6291729caffb(arg0, arg1, arg2) {
|
|
1557
1538
|
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
1558
1539
|
};
|
|
1559
1540
|
|
|
1560
|
-
export function
|
|
1561
|
-
const ret =
|
|
1562
|
-
return ret;
|
|
1541
|
+
export function __wbg_value_30db1d77772f3236(arg0) {
|
|
1542
|
+
const ret = getObject(arg0).value;
|
|
1543
|
+
return addHeapObject(ret);
|
|
1563
1544
|
};
|
|
1564
1545
|
|
|
1565
|
-
export function
|
|
1566
|
-
|
|
1567
|
-
try {
|
|
1568
|
-
result = getObject(arg0) instanceof ArrayBuffer;
|
|
1569
|
-
} catch (_) {
|
|
1570
|
-
result = false;
|
|
1571
|
-
}
|
|
1572
|
-
const ret = result;
|
|
1546
|
+
export function __wbindgen_as_number(arg0) {
|
|
1547
|
+
const ret = +getObject(arg0);
|
|
1573
1548
|
return ret;
|
|
1574
1549
|
};
|
|
1575
1550
|
|
|
1576
|
-
export function
|
|
1577
|
-
const ret =
|
|
1578
|
-
return ret;
|
|
1551
|
+
export function __wbindgen_bigint_from_i64(arg0) {
|
|
1552
|
+
const ret = arg0;
|
|
1553
|
+
return addHeapObject(ret);
|
|
1579
1554
|
};
|
|
1580
1555
|
|
|
1581
|
-
export function
|
|
1582
|
-
const ret =
|
|
1556
|
+
export function __wbindgen_bigint_from_u128(arg0, arg1) {
|
|
1557
|
+
const ret = BigInt.asUintN(64, arg0) << BigInt(64) | BigInt.asUintN(64, arg1);
|
|
1583
1558
|
return addHeapObject(ret);
|
|
1584
1559
|
};
|
|
1585
1560
|
|
|
1586
|
-
export function
|
|
1587
|
-
|
|
1561
|
+
export function __wbindgen_bigint_from_u64(arg0) {
|
|
1562
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
1563
|
+
return addHeapObject(ret);
|
|
1588
1564
|
};
|
|
1589
1565
|
|
|
1590
|
-
export function
|
|
1591
|
-
const
|
|
1592
|
-
|
|
1566
|
+
export function __wbindgen_bigint_get_as_i64(arg0, arg1) {
|
|
1567
|
+
const v = getObject(arg1);
|
|
1568
|
+
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
1569
|
+
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
1570
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
1593
1571
|
};
|
|
1594
1572
|
|
|
1595
|
-
export function
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
result = getObject(arg0) instanceof Uint8Array;
|
|
1599
|
-
} catch (_) {
|
|
1600
|
-
result = false;
|
|
1601
|
-
}
|
|
1602
|
-
const ret = result;
|
|
1573
|
+
export function __wbindgen_boolean_get(arg0) {
|
|
1574
|
+
const v = getObject(arg0);
|
|
1575
|
+
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
|
|
1603
1576
|
return ret;
|
|
1604
1577
|
};
|
|
1605
1578
|
|
|
1606
|
-
export function
|
|
1607
|
-
const ret =
|
|
1608
|
-
|
|
1579
|
+
export function __wbindgen_debug_string(arg0, arg1) {
|
|
1580
|
+
const ret = debugString(getObject(arg1));
|
|
1581
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1582
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1583
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1584
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1609
1585
|
};
|
|
1610
1586
|
|
|
1611
|
-
export function
|
|
1612
|
-
const ret =
|
|
1587
|
+
export function __wbindgen_error_new(arg0, arg1) {
|
|
1588
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
1613
1589
|
return addHeapObject(ret);
|
|
1614
1590
|
};
|
|
1615
1591
|
|
|
1616
|
-
export function
|
|
1617
|
-
const ret = arg0;
|
|
1618
|
-
return
|
|
1592
|
+
export function __wbindgen_in(arg0, arg1) {
|
|
1593
|
+
const ret = getObject(arg0) in getObject(arg1);
|
|
1594
|
+
return ret;
|
|
1619
1595
|
};
|
|
1620
1596
|
|
|
1621
|
-
export function
|
|
1622
|
-
const ret = getObject(arg0)
|
|
1597
|
+
export function __wbindgen_is_array(arg0) {
|
|
1598
|
+
const ret = Array.isArray(getObject(arg0));
|
|
1623
1599
|
return ret;
|
|
1624
1600
|
};
|
|
1625
1601
|
|
|
1626
|
-
export function
|
|
1627
|
-
const ret = getObject(arg0)
|
|
1602
|
+
export function __wbindgen_is_bigint(arg0) {
|
|
1603
|
+
const ret = typeof(getObject(arg0)) === 'bigint';
|
|
1628
1604
|
return ret;
|
|
1629
1605
|
};
|
|
1630
1606
|
|
|
1631
|
-
export function
|
|
1632
|
-
const
|
|
1633
|
-
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
|
|
1607
|
+
export function __wbindgen_is_function(arg0) {
|
|
1608
|
+
const ret = typeof(getObject(arg0)) === 'function';
|
|
1634
1609
|
return ret;
|
|
1635
1610
|
};
|
|
1636
1611
|
|
|
1637
|
-
export function
|
|
1638
|
-
const
|
|
1639
|
-
const
|
|
1640
|
-
|
|
1641
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1642
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1612
|
+
export function __wbindgen_is_object(arg0) {
|
|
1613
|
+
const val = getObject(arg0);
|
|
1614
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
1615
|
+
return ret;
|
|
1643
1616
|
};
|
|
1644
1617
|
|
|
1645
|
-
export function
|
|
1646
|
-
const ret =
|
|
1647
|
-
return
|
|
1618
|
+
export function __wbindgen_is_undefined(arg0) {
|
|
1619
|
+
const ret = getObject(arg0) === undefined;
|
|
1620
|
+
return ret;
|
|
1648
1621
|
};
|
|
1649
1622
|
|
|
1650
|
-
export function
|
|
1651
|
-
const ret =
|
|
1623
|
+
export function __wbindgen_jsval_eq(arg0, arg1) {
|
|
1624
|
+
const ret = getObject(arg0) === getObject(arg1);
|
|
1625
|
+
return ret;
|
|
1626
|
+
};
|
|
1627
|
+
|
|
1628
|
+
export function __wbindgen_jsval_loose_eq(arg0, arg1) {
|
|
1629
|
+
const ret = getObject(arg0) == getObject(arg1);
|
|
1630
|
+
return ret;
|
|
1631
|
+
};
|
|
1632
|
+
|
|
1633
|
+
export function __wbindgen_memory() {
|
|
1634
|
+
const ret = wasm.memory;
|
|
1652
1635
|
return addHeapObject(ret);
|
|
1653
1636
|
};
|
|
1654
1637
|
|
|
1655
|
-
export function
|
|
1656
|
-
const
|
|
1638
|
+
export function __wbindgen_number_get(arg0, arg1) {
|
|
1639
|
+
const obj = getObject(arg1);
|
|
1640
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
1641
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
1642
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
1643
|
+
};
|
|
1644
|
+
|
|
1645
|
+
export function __wbindgen_number_new(arg0) {
|
|
1646
|
+
const ret = arg0;
|
|
1657
1647
|
return addHeapObject(ret);
|
|
1658
1648
|
};
|
|
1659
1649
|
|
|
1660
|
-
export function
|
|
1661
|
-
|
|
1650
|
+
export function __wbindgen_object_clone_ref(arg0) {
|
|
1651
|
+
const ret = getObject(arg0);
|
|
1652
|
+
return addHeapObject(ret);
|
|
1662
1653
|
};
|
|
1663
1654
|
|
|
1664
|
-
export function
|
|
1665
|
-
|
|
1666
|
-
return ret;
|
|
1655
|
+
export function __wbindgen_object_drop_ref(arg0) {
|
|
1656
|
+
takeObject(arg0);
|
|
1667
1657
|
};
|
|
1668
1658
|
|
|
1669
|
-
export function
|
|
1670
|
-
const ret = getObject(arg0)
|
|
1659
|
+
export function __wbindgen_shr(arg0, arg1) {
|
|
1660
|
+
const ret = getObject(arg0) >> getObject(arg1);
|
|
1671
1661
|
return addHeapObject(ret);
|
|
1672
1662
|
};
|
|
1673
1663
|
|
|
1674
|
-
export function
|
|
1675
|
-
const
|
|
1676
|
-
|
|
1664
|
+
export function __wbindgen_string_get(arg0, arg1) {
|
|
1665
|
+
const obj = getObject(arg1);
|
|
1666
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
1667
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1668
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1669
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1670
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1677
1671
|
};
|
|
1678
1672
|
|
|
1679
|
-
export function
|
|
1680
|
-
const ret =
|
|
1681
|
-
return ret;
|
|
1673
|
+
export function __wbindgen_string_new(arg0, arg1) {
|
|
1674
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1675
|
+
return addHeapObject(ret);
|
|
1682
1676
|
};
|
|
1683
1677
|
|
|
1684
|
-
export function
|
|
1685
|
-
|
|
1686
|
-
return ret;
|
|
1678
|
+
export function __wbindgen_throw(arg0, arg1) {
|
|
1679
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1687
1680
|
};
|
|
1688
1681
|
|