@gmsol-labs/gmsol-sdk 0.8.0-beta.2 → 0.8.0-beta.3

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 CHANGED
@@ -1529,6 +1529,10 @@ export class Market {
1529
1529
  * Get short token address.
1530
1530
  */
1531
1531
  short_token_address(): string;
1532
+ /**
1533
+ * Create a clone of this market.
1534
+ */
1535
+ clone(): Market;
1532
1536
  }
1533
1537
  /**
1534
1538
  * A JS binding for [`MarketGraph`].
@@ -1587,6 +1591,10 @@ export class MarketGraph {
1587
1591
  * Update with simulator.
1588
1592
  */
1589
1593
  update_with_simulator(simulator: Simulator, options?: UpdateGraphWithSimulatorOptions | null): void;
1594
+ /**
1595
+ * Create a clone of this graph.
1596
+ */
1597
+ clone(): MarketGraph;
1590
1598
  }
1591
1599
  /**
1592
1600
  * Wrapper of [`MarketModel`].
@@ -1606,6 +1614,10 @@ export class MarketModel {
1606
1614
  * Create an empty position model.
1607
1615
  */
1608
1616
  create_empty_position(args: CreateEmptyPositionArgs): PositionModel;
1617
+ /**
1618
+ * Create a clone of this market model.
1619
+ */
1620
+ clone(): MarketModel;
1609
1621
  }
1610
1622
  /**
1611
1623
  * wasm-bindgen version of the Message struct.
@@ -1691,6 +1703,10 @@ export class Position {
1691
1703
  * Convert to a [`JsPositionModel`].
1692
1704
  */
1693
1705
  to_model(market: MarketModel): PositionModel;
1706
+ /**
1707
+ * Create a clone of this position.
1708
+ */
1709
+ clone(): Position;
1694
1710
  }
1695
1711
  /**
1696
1712
  * JS version of [`PositionModel`].
@@ -1722,6 +1738,10 @@ export class PositionModel {
1722
1738
  * Update with trade event.
1723
1739
  */
1724
1740
  update_with_trade_event(event: TradeEvent, force_update?: boolean | null): boolean;
1741
+ /**
1742
+ * Create a clone of this position model.
1743
+ */
1744
+ clone(): PositionModel;
1725
1745
  }
1726
1746
  /**
1727
1747
  * The address of a [Solana account][acc].
@@ -1798,6 +1818,10 @@ export class Simulator {
1798
1818
  */
1799
1819
  insert_price(token: string, price: Value): void;
1800
1820
  simulate_order(args: SimulateOrderArgs, position?: Position | null): OrderSimulationOutput;
1821
+ /**
1822
+ * Create a clone of this simulator.
1823
+ */
1824
+ clone(): Simulator;
1801
1825
  }
1802
1826
  /**
1803
1827
  * JS version of [`TradeEvent`].
package/index_bg.js CHANGED
@@ -799,6 +799,14 @@ export class Market {
799
799
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
800
800
  }
801
801
  }
802
+ /**
803
+ * Create a clone of this market.
804
+ * @returns {Market}
805
+ */
806
+ clone() {
807
+ const ret = wasm.market_clone(this.__wbg_ptr);
808
+ return Market.__wrap(ret);
809
+ }
802
810
  }
803
811
 
804
812
  const MarketGraphFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -809,6 +817,14 @@ const MarketGraphFinalization = (typeof FinalizationRegistry === 'undefined')
809
817
  */
810
818
  export class MarketGraph {
811
819
 
820
+ static __wrap(ptr) {
821
+ ptr = ptr >>> 0;
822
+ const obj = Object.create(MarketGraph.prototype);
823
+ obj.__wbg_ptr = ptr;
824
+ MarketGraphFinalization.register(obj, obj.__wbg_ptr, obj);
825
+ return obj;
826
+ }
827
+
812
828
  __destroy_into_raw() {
813
829
  const ptr = this.__wbg_ptr;
814
830
  this.__wbg_ptr = 0;
@@ -970,6 +986,14 @@ export class MarketGraph {
970
986
  throw takeFromExternrefTable0(ret[0]);
971
987
  }
972
988
  }
989
+ /**
990
+ * Create a clone of this graph.
991
+ * @returns {MarketGraph}
992
+ */
993
+ clone() {
994
+ const ret = wasm.marketgraph_clone(this.__wbg_ptr);
995
+ return MarketGraph.__wrap(ret);
996
+ }
973
997
  }
974
998
 
975
999
  const MarketModelFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -1035,6 +1059,14 @@ export class MarketModel {
1035
1059
  }
1036
1060
  return PositionModel.__wrap(ret[0]);
1037
1061
  }
1062
+ /**
1063
+ * Create a clone of this market model.
1064
+ * @returns {MarketModel}
1065
+ */
1066
+ clone() {
1067
+ const ret = wasm.marketmodel_clone(this.__wbg_ptr);
1068
+ return MarketModel.__wrap(ret);
1069
+ }
1038
1070
  }
1039
1071
 
1040
1072
  const MessageFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -1339,6 +1371,14 @@ export class Position {
1339
1371
  }
1340
1372
  return PositionModel.__wrap(ret[0]);
1341
1373
  }
1374
+ /**
1375
+ * Create a clone of this position.
1376
+ * @returns {Position}
1377
+ */
1378
+ clone() {
1379
+ const ret = wasm.position_clone(this.__wbg_ptr);
1380
+ return Position.__wrap(ret);
1381
+ }
1342
1382
  }
1343
1383
 
1344
1384
  const PositionModelFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -1426,6 +1466,14 @@ export class PositionModel {
1426
1466
  }
1427
1467
  return ret[0] !== 0;
1428
1468
  }
1469
+ /**
1470
+ * Create a clone of this position model.
1471
+ * @returns {PositionModel}
1472
+ */
1473
+ clone() {
1474
+ const ret = wasm.positionmodel_clone(this.__wbg_ptr);
1475
+ return PositionModel.__wrap(ret);
1476
+ }
1429
1477
  }
1430
1478
 
1431
1479
  const PubkeyFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -1667,6 +1715,14 @@ export class Simulator {
1667
1715
  }
1668
1716
  return OrderSimulationOutput.__wrap(ret[0]);
1669
1717
  }
1718
+ /**
1719
+ * Create a clone of this simulator.
1720
+ * @returns {Simulator}
1721
+ */
1722
+ clone() {
1723
+ const ret = wasm.simulator_clone(this.__wbg_ptr);
1724
+ return Simulator.__wrap(ret);
1725
+ }
1670
1726
  }
1671
1727
 
1672
1728
  const SystemInstructionFinalization = (typeof FinalizationRegistry === 'undefined')
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.8.0-beta.2",
5
+ "version": "0.8.0-beta.3",
6
6
  "license": "SEE LICENSE IN ../../LICENSE",
7
7
  "repository": {
8
8
  "type": "git",