@gmsol-labs/gmsol-sdk 0.9.0-alpha.1 → 0.9.0-alpha.2
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/index.d.ts +54 -0
- package/index_bg.js +168 -0
- package/index_bg.wasm +0 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -2230,6 +2230,22 @@ export class Simulator {
|
|
|
2230
2230
|
* Upsert a GLV model.
|
|
2231
2231
|
*/
|
|
2232
2232
|
insert_glv(glv: GlvModel): void;
|
|
2233
|
+
/**
|
|
2234
|
+
* Insert a virtual inventory model.
|
|
2235
|
+
*/
|
|
2236
|
+
insert_vi(vi_address: string, vi: VirtualInventoryModel): void;
|
|
2237
|
+
/**
|
|
2238
|
+
* Get virtual inventory model by address.
|
|
2239
|
+
*/
|
|
2240
|
+
get_vi(vi_address: string): VirtualInventoryModel | undefined;
|
|
2241
|
+
/**
|
|
2242
|
+
* Set whether to disable virtual inventories for simulations.
|
|
2243
|
+
*/
|
|
2244
|
+
set_disable_vis(disable: boolean): void;
|
|
2245
|
+
/**
|
|
2246
|
+
* Get whether virtual inventories are disabled.
|
|
2247
|
+
*/
|
|
2248
|
+
disable_vis(): boolean;
|
|
2233
2249
|
/**
|
|
2234
2250
|
* Simulate an order execution.
|
|
2235
2251
|
*/
|
|
@@ -2380,6 +2396,44 @@ export class User {
|
|
|
2380
2396
|
*/
|
|
2381
2397
|
gt_minted_fee_value(): bigint;
|
|
2382
2398
|
}
|
|
2399
|
+
/**
|
|
2400
|
+
* Wrapper of [`VirtualInventory`].
|
|
2401
|
+
*/
|
|
2402
|
+
export class VirtualInventory {
|
|
2403
|
+
private constructor();
|
|
2404
|
+
free(): void;
|
|
2405
|
+
/**
|
|
2406
|
+
* Create from base64 encoded account data with options.
|
|
2407
|
+
*/
|
|
2408
|
+
static decode_from_base64_with_options(data: string, no_discriminator?: boolean | null): VirtualInventory;
|
|
2409
|
+
/**
|
|
2410
|
+
* Create from base64 encoded account data.
|
|
2411
|
+
*/
|
|
2412
|
+
static decode_from_base64(data: string): VirtualInventory;
|
|
2413
|
+
/**
|
|
2414
|
+
* Create from account data.
|
|
2415
|
+
*/
|
|
2416
|
+
static decode(data: Uint8Array): VirtualInventory;
|
|
2417
|
+
/**
|
|
2418
|
+
* Convert into [`JsVirtualInventoryModel`].
|
|
2419
|
+
*/
|
|
2420
|
+
to_model(): VirtualInventoryModel;
|
|
2421
|
+
/**
|
|
2422
|
+
* Create a clone of this virtual inventory.
|
|
2423
|
+
*/
|
|
2424
|
+
clone(): VirtualInventory;
|
|
2425
|
+
}
|
|
2426
|
+
/**
|
|
2427
|
+
* Wrapper of [`VirtualInventoryModel`].
|
|
2428
|
+
*/
|
|
2429
|
+
export class VirtualInventoryModel {
|
|
2430
|
+
private constructor();
|
|
2431
|
+
free(): void;
|
|
2432
|
+
/**
|
|
2433
|
+
* Create a clone of this virtual inventory model.
|
|
2434
|
+
*/
|
|
2435
|
+
clone(): VirtualInventoryModel;
|
|
2436
|
+
}
|
|
2383
2437
|
/**
|
|
2384
2438
|
* Simulation output for withdrawal.
|
|
2385
2439
|
*/
|
package/index_bg.js
CHANGED
|
@@ -2635,6 +2635,49 @@ export class Simulator {
|
|
|
2635
2635
|
throw takeFromExternrefTable0(ret[0]);
|
|
2636
2636
|
}
|
|
2637
2637
|
}
|
|
2638
|
+
/**
|
|
2639
|
+
* Insert a virtual inventory model.
|
|
2640
|
+
* @param {string} vi_address
|
|
2641
|
+
* @param {VirtualInventoryModel} vi
|
|
2642
|
+
*/
|
|
2643
|
+
insert_vi(vi_address, vi) {
|
|
2644
|
+
const ptr0 = passStringToWasm0(vi_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2645
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2646
|
+
_assertClass(vi, VirtualInventoryModel);
|
|
2647
|
+
const ret = wasm.simulator_insert_vi(this.__wbg_ptr, ptr0, len0, vi.__wbg_ptr);
|
|
2648
|
+
if (ret[1]) {
|
|
2649
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
2650
|
+
}
|
|
2651
|
+
}
|
|
2652
|
+
/**
|
|
2653
|
+
* Get virtual inventory model by address.
|
|
2654
|
+
* @param {string} vi_address
|
|
2655
|
+
* @returns {VirtualInventoryModel | undefined}
|
|
2656
|
+
*/
|
|
2657
|
+
get_vi(vi_address) {
|
|
2658
|
+
const ptr0 = passStringToWasm0(vi_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2659
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2660
|
+
const ret = wasm.simulator_get_vi(this.__wbg_ptr, ptr0, len0);
|
|
2661
|
+
if (ret[2]) {
|
|
2662
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2663
|
+
}
|
|
2664
|
+
return ret[0] === 0 ? undefined : VirtualInventoryModel.__wrap(ret[0]);
|
|
2665
|
+
}
|
|
2666
|
+
/**
|
|
2667
|
+
* Set whether to disable virtual inventories for simulations.
|
|
2668
|
+
* @param {boolean} disable
|
|
2669
|
+
*/
|
|
2670
|
+
set_disable_vis(disable) {
|
|
2671
|
+
wasm.simulator_set_disable_vis(this.__wbg_ptr, disable);
|
|
2672
|
+
}
|
|
2673
|
+
/**
|
|
2674
|
+
* Get whether virtual inventories are disabled.
|
|
2675
|
+
* @returns {boolean}
|
|
2676
|
+
*/
|
|
2677
|
+
disable_vis() {
|
|
2678
|
+
const ret = wasm.simulator_disable_vis(this.__wbg_ptr);
|
|
2679
|
+
return ret !== 0;
|
|
2680
|
+
}
|
|
2638
2681
|
/**
|
|
2639
2682
|
* Simulate an order execution.
|
|
2640
2683
|
* @param {SimulateOrderArgs} args
|
|
@@ -3327,6 +3370,131 @@ export class User {
|
|
|
3327
3370
|
}
|
|
3328
3371
|
}
|
|
3329
3372
|
|
|
3373
|
+
const VirtualInventoryFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3374
|
+
? { register: () => {}, unregister: () => {} }
|
|
3375
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_virtualinventory_free(ptr >>> 0, 1));
|
|
3376
|
+
/**
|
|
3377
|
+
* Wrapper of [`VirtualInventory`].
|
|
3378
|
+
*/
|
|
3379
|
+
export class VirtualInventory {
|
|
3380
|
+
|
|
3381
|
+
static __wrap(ptr) {
|
|
3382
|
+
ptr = ptr >>> 0;
|
|
3383
|
+
const obj = Object.create(VirtualInventory.prototype);
|
|
3384
|
+
obj.__wbg_ptr = ptr;
|
|
3385
|
+
VirtualInventoryFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
3386
|
+
return obj;
|
|
3387
|
+
}
|
|
3388
|
+
|
|
3389
|
+
__destroy_into_raw() {
|
|
3390
|
+
const ptr = this.__wbg_ptr;
|
|
3391
|
+
this.__wbg_ptr = 0;
|
|
3392
|
+
VirtualInventoryFinalization.unregister(this);
|
|
3393
|
+
return ptr;
|
|
3394
|
+
}
|
|
3395
|
+
|
|
3396
|
+
free() {
|
|
3397
|
+
const ptr = this.__destroy_into_raw();
|
|
3398
|
+
wasm.__wbg_virtualinventory_free(ptr, 0);
|
|
3399
|
+
}
|
|
3400
|
+
/**
|
|
3401
|
+
* Create from base64 encoded account data with options.
|
|
3402
|
+
* @param {string} data
|
|
3403
|
+
* @param {boolean | null} [no_discriminator]
|
|
3404
|
+
* @returns {VirtualInventory}
|
|
3405
|
+
*/
|
|
3406
|
+
static decode_from_base64_with_options(data, no_discriminator) {
|
|
3407
|
+
const ptr0 = passStringToWasm0(data, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3408
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3409
|
+
const ret = wasm.virtualinventory_decode_from_base64_with_options(ptr0, len0, isLikeNone(no_discriminator) ? 0xFFFFFF : no_discriminator ? 1 : 0);
|
|
3410
|
+
if (ret[2]) {
|
|
3411
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3412
|
+
}
|
|
3413
|
+
return VirtualInventory.__wrap(ret[0]);
|
|
3414
|
+
}
|
|
3415
|
+
/**
|
|
3416
|
+
* Create from base64 encoded account data.
|
|
3417
|
+
* @param {string} data
|
|
3418
|
+
* @returns {VirtualInventory}
|
|
3419
|
+
*/
|
|
3420
|
+
static decode_from_base64(data) {
|
|
3421
|
+
const ptr0 = passStringToWasm0(data, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3422
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3423
|
+
const ret = wasm.virtualinventory_decode_from_base64(ptr0, len0);
|
|
3424
|
+
if (ret[2]) {
|
|
3425
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3426
|
+
}
|
|
3427
|
+
return VirtualInventory.__wrap(ret[0]);
|
|
3428
|
+
}
|
|
3429
|
+
/**
|
|
3430
|
+
* Create from account data.
|
|
3431
|
+
* @param {Uint8Array} data
|
|
3432
|
+
* @returns {VirtualInventory}
|
|
3433
|
+
*/
|
|
3434
|
+
static decode(data) {
|
|
3435
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
3436
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3437
|
+
const ret = wasm.virtualinventory_decode(ptr0, len0);
|
|
3438
|
+
if (ret[2]) {
|
|
3439
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3440
|
+
}
|
|
3441
|
+
return VirtualInventory.__wrap(ret[0]);
|
|
3442
|
+
}
|
|
3443
|
+
/**
|
|
3444
|
+
* Convert into [`JsVirtualInventoryModel`].
|
|
3445
|
+
* @returns {VirtualInventoryModel}
|
|
3446
|
+
*/
|
|
3447
|
+
to_model() {
|
|
3448
|
+
const ret = wasm.virtualinventory_to_model(this.__wbg_ptr);
|
|
3449
|
+
return VirtualInventoryModel.__wrap(ret);
|
|
3450
|
+
}
|
|
3451
|
+
/**
|
|
3452
|
+
* Create a clone of this virtual inventory.
|
|
3453
|
+
* @returns {VirtualInventory}
|
|
3454
|
+
*/
|
|
3455
|
+
clone() {
|
|
3456
|
+
const ret = wasm.virtualinventory_clone(this.__wbg_ptr);
|
|
3457
|
+
return VirtualInventory.__wrap(ret);
|
|
3458
|
+
}
|
|
3459
|
+
}
|
|
3460
|
+
|
|
3461
|
+
const VirtualInventoryModelFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3462
|
+
? { register: () => {}, unregister: () => {} }
|
|
3463
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_virtualinventorymodel_free(ptr >>> 0, 1));
|
|
3464
|
+
/**
|
|
3465
|
+
* Wrapper of [`VirtualInventoryModel`].
|
|
3466
|
+
*/
|
|
3467
|
+
export class VirtualInventoryModel {
|
|
3468
|
+
|
|
3469
|
+
static __wrap(ptr) {
|
|
3470
|
+
ptr = ptr >>> 0;
|
|
3471
|
+
const obj = Object.create(VirtualInventoryModel.prototype);
|
|
3472
|
+
obj.__wbg_ptr = ptr;
|
|
3473
|
+
VirtualInventoryModelFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
3474
|
+
return obj;
|
|
3475
|
+
}
|
|
3476
|
+
|
|
3477
|
+
__destroy_into_raw() {
|
|
3478
|
+
const ptr = this.__wbg_ptr;
|
|
3479
|
+
this.__wbg_ptr = 0;
|
|
3480
|
+
VirtualInventoryModelFinalization.unregister(this);
|
|
3481
|
+
return ptr;
|
|
3482
|
+
}
|
|
3483
|
+
|
|
3484
|
+
free() {
|
|
3485
|
+
const ptr = this.__destroy_into_raw();
|
|
3486
|
+
wasm.__wbg_virtualinventorymodel_free(ptr, 0);
|
|
3487
|
+
}
|
|
3488
|
+
/**
|
|
3489
|
+
* Create a clone of this virtual inventory model.
|
|
3490
|
+
* @returns {VirtualInventoryModel}
|
|
3491
|
+
*/
|
|
3492
|
+
clone() {
|
|
3493
|
+
const ret = wasm.virtualinventorymodel_clone(this.__wbg_ptr);
|
|
3494
|
+
return VirtualInventoryModel.__wrap(ret);
|
|
3495
|
+
}
|
|
3496
|
+
}
|
|
3497
|
+
|
|
3330
3498
|
const WithdrawalSimulationOutputFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3331
3499
|
? { register: () => {}, unregister: () => {} }
|
|
3332
3500
|
: new FinalizationRegistry(ptr => wasm.__wbg_withdrawalsimulationoutput_free(ptr >>> 0, 1));
|
package/index_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@gmsol-labs/gmsol-sdk",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"description": "GMX-Solana is an extension of GMX on the Solana blockchain.",
|
|
5
|
-
"version": "0.9.0-alpha.
|
|
5
|
+
"version": "0.9.0-alpha.2",
|
|
6
6
|
"license": "SEE LICENSE IN ../../LICENSE",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|