@crypticdot/defituna-core 3.2.7 → 3.3.1

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.
@@ -191,11 +191,6 @@ function handleError(f, args) {
191
191
  }
192
192
  }
193
193
 
194
- function getArrayU8FromWasm0(ptr, len) {
195
- ptr = ptr >>> 0;
196
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
197
- }
198
-
199
194
  function dropObject(idx) {
200
195
  if (idx < 132) return;
201
196
  heap[idx] = heap_next;
@@ -207,6 +202,66 @@ function takeObject(idx) {
207
202
  dropObject(idx);
208
203
  return ret;
209
204
  }
205
+
206
+ function getArrayU8FromWasm0(ptr, len) {
207
+ ptr = ptr >>> 0;
208
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
209
+ }
210
+
211
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
212
+ ? { register: () => {}, unregister: () => {} }
213
+ : new FinalizationRegistry(state => state.dtor(state.a, state.b));
214
+
215
+ function makeMutClosure(arg0, arg1, dtor, f) {
216
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
217
+ const real = (...args) => {
218
+
219
+ // First up with a closure we increment the internal reference
220
+ // count. This ensures that the Rust closure environment won't
221
+ // be deallocated while we're invoking it.
222
+ state.cnt++;
223
+ const a = state.a;
224
+ state.a = 0;
225
+ try {
226
+ return f(a, state.b, ...args);
227
+ } finally {
228
+ state.a = a;
229
+ real._wbg_cb_unref();
230
+ }
231
+ };
232
+ real._wbg_cb_unref = () => {
233
+ if (--state.cnt === 0) {
234
+ state.dtor(state.a, state.b);
235
+ state.a = 0;
236
+ CLOSURE_DTORS.unregister(state);
237
+ }
238
+ };
239
+ CLOSURE_DTORS.register(real, state, state);
240
+ return real;
241
+ }
242
+
243
+ function _assertClass(instance, klass) {
244
+ if (!(instance instanceof klass)) {
245
+ throw new Error(`expected instance of ${klass.name}`);
246
+ }
247
+ }
248
+
249
+ function passArrayJsValueToWasm0(array, malloc) {
250
+ const ptr = malloc(array.length * 4, 4) >>> 0;
251
+ const mem = getDataViewMemory0();
252
+ for (let i = 0; i < array.length; i++) {
253
+ mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
254
+ }
255
+ WASM_VECTOR_LEN = array.length;
256
+ return ptr;
257
+ }
258
+
259
+ function passArray8ToWasm0(arg, malloc) {
260
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
261
+ getUint8ArrayMemory0().set(arg, ptr / 1);
262
+ WASM_VECTOR_LEN = arg.length;
263
+ return ptr;
264
+ }
210
265
  /**
211
266
  * Get the first tick index in the tick array that contains the specified tick index.
212
267
  *
@@ -1436,12 +1491,6 @@ export function _PROTOCOL_FEE_RATE_MUL_VALUE() {
1436
1491
  return ret;
1437
1492
  }
1438
1493
 
1439
- function passArray8ToWasm0(arg, malloc) {
1440
- const ptr = malloc(arg.length * 1, 1) >>> 0;
1441
- getUint8ArrayMemory0().set(arg, ptr / 1);
1442
- WASM_VECTOR_LEN = arg.length;
1443
- return ptr;
1444
- }
1445
1494
  /**
1446
1495
  * Get the first unoccupied position in a bundle
1447
1496
  *
@@ -1606,18 +1655,6 @@ export function swapQuoteByOutputToken(token_out, specified_token_a, slippage_to
1606
1655
  }
1607
1656
  }
1608
1657
 
1609
- export function _INVALID_ARGUMENTS() {
1610
- try {
1611
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1612
- wasm._INVALID_ARGUMENTS(retptr);
1613
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1614
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1615
- return getStringFromWasm0(r0, r1);
1616
- } finally {
1617
- wasm.__wbindgen_add_to_stack_pointer(16);
1618
- }
1619
- }
1620
-
1621
1658
  /**
1622
1659
  * Spot position increase quote
1623
1660
  *
@@ -1629,26 +1666,21 @@ export function _INVALID_ARGUMENTS() {
1629
1666
  * - `slippage_tolerance_bps`: An optional slippage tolerance in basis points. Defaults to the global slippage tolerance if not provided.
1630
1667
  * - `protocol_fee_rate`: Protocol fee rate from a market account represented as hundredths of a basis point (0.01% = 100).
1631
1668
  * - `protocol_fee_rate_on_collateral`: Protocol fee rate from a market account represented as hundredths of a basis point (0.01% = 100).
1669
+ * - `mint_a`: Token A mint address
1670
+ * - `mint_b`: Token B mint address
1632
1671
  * - `fusion_pool`: Fusion pool.
1633
- * - `tick_arrays`: Five tick arrays around the current pool price.
1672
+ * - `tick_arrays`: Optional five tick arrays around the current pool price. If not provided, the quote will be calculated using the Jupiter Aggregator.
1634
1673
  *
1635
1674
  * # Returns
1636
1675
  * - `IncreaseSpotPositionQuoteResult`: quote result
1637
1676
  */
1638
- export function getIncreaseSpotPositionQuote(increase_amount, collateral_token, position_token, leverage, slippage_tolerance_bps, protocol_fee_rate, protocol_fee_rate_on_collateral, fusion_pool, tick_arrays) {
1639
- try {
1640
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1641
- wasm.getIncreaseSpotPositionQuote(retptr, increase_amount, collateral_token, position_token, leverage, isLikeNone(slippage_tolerance_bps) ? 0xFFFFFF : slippage_tolerance_bps, protocol_fee_rate, protocol_fee_rate_on_collateral, addHeapObject(fusion_pool), addHeapObject(tick_arrays));
1642
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1643
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1644
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1645
- if (r2) {
1646
- throw takeObject(r1);
1647
- }
1648
- return takeObject(r0);
1649
- } finally {
1650
- wasm.__wbindgen_add_to_stack_pointer(16);
1651
- }
1677
+ export function getIncreaseSpotPositionQuote(increase_amount, collateral_token, position_token, leverage, slippage_tolerance_bps, protocol_fee_rate, protocol_fee_rate_on_collateral, mint_a, mint_b, fusion_pool, tick_arrays) {
1678
+ _assertClass(mint_a, Pubkey);
1679
+ var ptr0 = mint_a.__destroy_into_raw();
1680
+ _assertClass(mint_b, Pubkey);
1681
+ var ptr1 = mint_b.__destroy_into_raw();
1682
+ const ret = wasm.getIncreaseSpotPositionQuote(increase_amount, collateral_token, position_token, leverage, isLikeNone(slippage_tolerance_bps) ? 0xFFFFFF : slippage_tolerance_bps, protocol_fee_rate, protocol_fee_rate_on_collateral, ptr0, ptr1, addHeapObject(fusion_pool), isLikeNone(tick_arrays) ? 0 : addHeapObject(tick_arrays));
1683
+ return takeObject(ret);
1652
1684
  }
1653
1685
 
1654
1686
  /**
@@ -1658,33 +1690,23 @@ export function getIncreaseSpotPositionQuote(increase_amount, collateral_token,
1658
1690
  * - `decrease_amount`: Position total decrease size in the collateral_token.
1659
1691
  * - `collateral_token`: Collateral token.
1660
1692
  * - `leverage`: Leverage (1.0 or higher).
1661
- * - `reduce_only`: Only allow reducing the existing position.
1662
1693
  * - `slippage_tolerance_bps`: An optional slippage tolerance in basis points. Defaults to the global slippage tolerance if not provided.
1663
1694
  * - `position_token`: Token of the existing position.
1664
1695
  * - `position_amount`: Existing position amount in the position_token.
1665
1696
  * - `position_debt`: Existing position debt in the token opposite to the position_token.
1666
- * - `protocol_fee_rate`: Protocol fee rate from a market account represented as hundredths of a basis point (0.01% = 100).
1667
- * - `protocol_fee_rate_on_collateral`: Protocol fee rate from a market account represented as hundredths of a basis point (0.01% = 100).
1668
1697
  * - `fusion_pool`: Fusion pool.
1669
- * - `tick_arrays`: Five tick arrays around the current pool price.
1698
+ * - `tick_arrays`: Optional five tick arrays around the current pool price. If not provided, the quote will be calculated using the Jupiter Aggregator.
1670
1699
  *
1671
1700
  * # Returns
1672
1701
  * - `DecreaseSpotPositionQuoteResult`: quote result
1673
1702
  */
1674
- export function getDecreaseSpotPositionQuote(decrease_amount, collateral_token, leverage, reduce_only, slippage_tolerance_bps, position_token, position_amount, position_debt, protocol_fee_rate, protocol_fee_rate_on_collateral, fusion_pool, tick_arrays) {
1675
- try {
1676
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1677
- wasm.getDecreaseSpotPositionQuote(retptr, decrease_amount, collateral_token, leverage, reduce_only, isLikeNone(slippage_tolerance_bps) ? 0xFFFFFF : slippage_tolerance_bps, position_token, position_amount, position_debt, protocol_fee_rate, protocol_fee_rate_on_collateral, addHeapObject(fusion_pool), addHeapObject(tick_arrays));
1678
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1679
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1680
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1681
- if (r2) {
1682
- throw takeObject(r1);
1683
- }
1684
- return takeObject(r0);
1685
- } finally {
1686
- wasm.__wbindgen_add_to_stack_pointer(16);
1687
- }
1703
+ export function getDecreaseSpotPositionQuote(decrease_amount, collateral_token, leverage, slippage_tolerance_bps, position_token, position_amount, position_debt, mint_a, mint_b, fusion_pool, tick_arrays) {
1704
+ _assertClass(mint_a, Pubkey);
1705
+ var ptr0 = mint_a.__destroy_into_raw();
1706
+ _assertClass(mint_b, Pubkey);
1707
+ var ptr1 = mint_b.__destroy_into_raw();
1708
+ const ret = wasm.getDecreaseSpotPositionQuote(decrease_amount, collateral_token, leverage, isLikeNone(slippage_tolerance_bps) ? 0xFFFFFF : slippage_tolerance_bps, position_token, position_amount, position_debt, ptr0, ptr1, addHeapObject(fusion_pool), isLikeNone(tick_arrays) ? 0 : addHeapObject(tick_arrays));
1709
+ return takeObject(ret);
1688
1710
  }
1689
1711
 
1690
1712
  /**
@@ -1722,23 +1744,20 @@ export function getLiquidationPrice(position_token, amount, debt, liquidation_th
1722
1744
  * - `collateral_token`: Collateral token.
1723
1745
  * - `available_balance`: Available wallet balance in the collateral_token.
1724
1746
  * - `leverage`: Leverage (1.0 or higher).
1725
- * - `new_position_token`: Token of the new position.
1726
1747
  * - `position_token`: Token of the existing position. Should be set to new_position_token if position_amount is zero.
1727
1748
  * - `position_amount`: Existing position amount in the position_token.
1728
- * - `position_debt`: Existing position debt in the token opposite to the position_token.
1729
- * - `reduce_only`: Only allow reducing the existing position.///
1730
1749
  * - `protocol_fee_rate`: Protocol fee rate from a market account represented as hundredths of a basis point (0.01% = 100).
1731
1750
  * - `protocol_fee_rate_on_collateral`: Protocol fee rate from a market account represented as hundredths of a basis point (0.01% = 100).
1732
1751
  * - `fusion_pool`: Fusion pool.
1733
- * - `tick_arrays`: Five tick arrays around the current pool price.
1752
+ * - `increase`: true if increasing the position
1734
1753
  *
1735
1754
  * # Returns
1736
1755
  * - `u64`: the maximum tradable amount
1737
1756
  */
1738
- export function getTradableAmount(collateral_token, available_balance, leverage, new_position_token, reduce_only, position_token, position_amount, position_debt, protocol_fee_rate, protocol_fee_rate_on_collateral, fusion_pool, tick_arrays) {
1757
+ export function getTradableAmount(collateral_token, available_balance, leverage, position_token, position_amount, protocol_fee_rate, protocol_fee_rate_on_collateral, fusion_pool, increase) {
1739
1758
  try {
1740
1759
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1741
- wasm.getTradableAmount(retptr, collateral_token, available_balance, leverage, new_position_token, reduce_only, position_token, position_amount, position_debt, protocol_fee_rate, protocol_fee_rate_on_collateral, addHeapObject(fusion_pool), addHeapObject(tick_arrays));
1760
+ wasm.getTradableAmount(retptr, collateral_token, available_balance, leverage, position_token, position_amount, protocol_fee_rate, protocol_fee_rate_on_collateral, addHeapObject(fusion_pool), increase);
1742
1761
  var r0 = getDataViewMemory0().getBigInt64(retptr + 8 * 0, true);
1743
1762
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1744
1763
  var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
@@ -1756,6 +1775,908 @@ export function calculateTunaProtocolFee(collateral_token, borrowed_token, colla
1756
1775
  return takeObject(ret);
1757
1776
  }
1758
1777
 
1778
+ export function _INVALID_ARGUMENTS() {
1779
+ try {
1780
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1781
+ wasm._INVALID_ARGUMENTS(retptr);
1782
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1783
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1784
+ return getStringFromWasm0(r0, r1);
1785
+ } finally {
1786
+ wasm.__wbindgen_add_to_stack_pointer(16);
1787
+ }
1788
+ }
1789
+
1790
+ export function _JUPITER_QUOTE_REQUEST_ERROR() {
1791
+ try {
1792
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1793
+ wasm._JUPITER_QUOTE_REQUEST_ERROR(retptr);
1794
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1795
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1796
+ return getStringFromWasm0(r0, r1);
1797
+ } finally {
1798
+ wasm.__wbindgen_add_to_stack_pointer(16);
1799
+ }
1800
+ }
1801
+
1802
+ export function _JUPITER_SWAP_INSTRUCTIONS_REQUEST_ERROR() {
1803
+ try {
1804
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1805
+ wasm._JUPITER_SWAP_INSTRUCTIONS_REQUEST_ERROR(retptr);
1806
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1807
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1808
+ return getStringFromWasm0(r0, r1);
1809
+ } finally {
1810
+ wasm.__wbindgen_add_to_stack_pointer(16);
1811
+ }
1812
+ }
1813
+
1814
+ /**
1815
+ * Initialize Javascript logging and panic handler
1816
+ */
1817
+ export function solana_program_init() {
1818
+ wasm.solana_program_init();
1819
+ }
1820
+
1821
+ function __wasm_bindgen_func_elem_3203(arg0, arg1, arg2) {
1822
+ wasm.__wasm_bindgen_func_elem_3203(arg0, arg1, addHeapObject(arg2));
1823
+ }
1824
+
1825
+ function __wasm_bindgen_func_elem_3097(arg0, arg1) {
1826
+ wasm.__wasm_bindgen_func_elem_3097(arg0, arg1);
1827
+ }
1828
+
1829
+ function __wasm_bindgen_func_elem_480(arg0, arg1, arg2, arg3) {
1830
+ wasm.__wasm_bindgen_func_elem_480(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
1831
+ }
1832
+
1833
+ const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
1834
+
1835
+ const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
1836
+
1837
+ const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
1838
+
1839
+ const HashFinalization = (typeof FinalizationRegistry === 'undefined')
1840
+ ? { register: () => {}, unregister: () => {} }
1841
+ : new FinalizationRegistry(ptr => wasm.__wbg_hash_free(ptr >>> 0, 1));
1842
+ /**
1843
+ * A hash; the 32-byte output of a hashing algorithm.
1844
+ *
1845
+ * This struct is used most often in `solana-sdk` and related crates to contain
1846
+ * a [SHA-256] hash, but may instead contain a [blake3] hash.
1847
+ *
1848
+ * [SHA-256]: https://en.wikipedia.org/wiki/SHA-2
1849
+ * [blake3]: https://github.com/BLAKE3-team/BLAKE3
1850
+ */
1851
+ export class Hash {
1852
+
1853
+ static __wrap(ptr) {
1854
+ ptr = ptr >>> 0;
1855
+ const obj = Object.create(Hash.prototype);
1856
+ obj.__wbg_ptr = ptr;
1857
+ HashFinalization.register(obj, obj.__wbg_ptr, obj);
1858
+ return obj;
1859
+ }
1860
+
1861
+ __destroy_into_raw() {
1862
+ const ptr = this.__wbg_ptr;
1863
+ this.__wbg_ptr = 0;
1864
+ HashFinalization.unregister(this);
1865
+ return ptr;
1866
+ }
1867
+
1868
+ free() {
1869
+ const ptr = this.__destroy_into_raw();
1870
+ wasm.__wbg_hash_free(ptr, 0);
1871
+ }
1872
+ /**
1873
+ * Create a new Hash object
1874
+ *
1875
+ * * `value` - optional hash as a base58 encoded string, `Uint8Array`, `[number]`
1876
+ * @param {any} value
1877
+ */
1878
+ constructor(value) {
1879
+ try {
1880
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1881
+ wasm.hash_constructor(retptr, addHeapObject(value));
1882
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1883
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1884
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1885
+ if (r2) {
1886
+ throw takeObject(r1);
1887
+ }
1888
+ this.__wbg_ptr = r0 >>> 0;
1889
+ HashFinalization.register(this, this.__wbg_ptr, this);
1890
+ return this;
1891
+ } finally {
1892
+ wasm.__wbindgen_add_to_stack_pointer(16);
1893
+ }
1894
+ }
1895
+ /**
1896
+ * Return the base58 string representation of the hash
1897
+ * @returns {string}
1898
+ */
1899
+ toString() {
1900
+ let deferred1_0;
1901
+ let deferred1_1;
1902
+ try {
1903
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1904
+ wasm.hash_toString(retptr, this.__wbg_ptr);
1905
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1906
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1907
+ deferred1_0 = r0;
1908
+ deferred1_1 = r1;
1909
+ return getStringFromWasm0(r0, r1);
1910
+ } finally {
1911
+ wasm.__wbindgen_add_to_stack_pointer(16);
1912
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
1913
+ }
1914
+ }
1915
+ /**
1916
+ * Checks if two `Hash`s are equal
1917
+ * @param {Hash} other
1918
+ * @returns {boolean}
1919
+ */
1920
+ equals(other) {
1921
+ _assertClass(other, Hash);
1922
+ const ret = wasm.hash_equals(this.__wbg_ptr, other.__wbg_ptr);
1923
+ return ret !== 0;
1924
+ }
1925
+ /**
1926
+ * Return the `Uint8Array` representation of the hash
1927
+ * @returns {Uint8Array}
1928
+ */
1929
+ toBytes() {
1930
+ try {
1931
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1932
+ wasm.hash_toBytes(retptr, this.__wbg_ptr);
1933
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1934
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1935
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
1936
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
1937
+ return v1;
1938
+ } finally {
1939
+ wasm.__wbindgen_add_to_stack_pointer(16);
1940
+ }
1941
+ }
1942
+ }
1943
+ if (Symbol.dispose) Hash.prototype[Symbol.dispose] = Hash.prototype.free;
1944
+
1945
+ const InstructionFinalization = (typeof FinalizationRegistry === 'undefined')
1946
+ ? { register: () => {}, unregister: () => {} }
1947
+ : new FinalizationRegistry(ptr => wasm.__wbg_instruction_free(ptr >>> 0, 1));
1948
+ /**
1949
+ * wasm-bindgen version of the Instruction struct.
1950
+ * This duplication is required until https://github.com/rustwasm/wasm-bindgen/issues/3671
1951
+ * is fixed. This must not diverge from the regular non-wasm Instruction struct.
1952
+ */
1953
+ export class Instruction {
1954
+
1955
+ static __wrap(ptr) {
1956
+ ptr = ptr >>> 0;
1957
+ const obj = Object.create(Instruction.prototype);
1958
+ obj.__wbg_ptr = ptr;
1959
+ InstructionFinalization.register(obj, obj.__wbg_ptr, obj);
1960
+ return obj;
1961
+ }
1962
+
1963
+ __destroy_into_raw() {
1964
+ const ptr = this.__wbg_ptr;
1965
+ this.__wbg_ptr = 0;
1966
+ InstructionFinalization.unregister(this);
1967
+ return ptr;
1968
+ }
1969
+
1970
+ free() {
1971
+ const ptr = this.__destroy_into_raw();
1972
+ wasm.__wbg_instruction_free(ptr, 0);
1973
+ }
1974
+ }
1975
+ if (Symbol.dispose) Instruction.prototype[Symbol.dispose] = Instruction.prototype.free;
1976
+
1977
+ const InstructionsFinalization = (typeof FinalizationRegistry === 'undefined')
1978
+ ? { register: () => {}, unregister: () => {} }
1979
+ : new FinalizationRegistry(ptr => wasm.__wbg_instructions_free(ptr >>> 0, 1));
1980
+
1981
+ export class Instructions {
1982
+
1983
+ __destroy_into_raw() {
1984
+ const ptr = this.__wbg_ptr;
1985
+ this.__wbg_ptr = 0;
1986
+ InstructionsFinalization.unregister(this);
1987
+ return ptr;
1988
+ }
1989
+
1990
+ free() {
1991
+ const ptr = this.__destroy_into_raw();
1992
+ wasm.__wbg_instructions_free(ptr, 0);
1993
+ }
1994
+ constructor() {
1995
+ const ret = wasm.instructions_constructor();
1996
+ this.__wbg_ptr = ret >>> 0;
1997
+ InstructionsFinalization.register(this, this.__wbg_ptr, this);
1998
+ return this;
1999
+ }
2000
+ /**
2001
+ * @param {Instruction} instruction
2002
+ */
2003
+ push(instruction) {
2004
+ _assertClass(instruction, Instruction);
2005
+ var ptr0 = instruction.__destroy_into_raw();
2006
+ wasm.instructions_push(this.__wbg_ptr, ptr0);
2007
+ }
2008
+ }
2009
+ if (Symbol.dispose) Instructions.prototype[Symbol.dispose] = Instructions.prototype.free;
2010
+
2011
+ const KeypairFinalization = (typeof FinalizationRegistry === 'undefined')
2012
+ ? { register: () => {}, unregister: () => {} }
2013
+ : new FinalizationRegistry(ptr => wasm.__wbg_keypair_free(ptr >>> 0, 1));
2014
+ /**
2015
+ * A vanilla Ed25519 key pair
2016
+ */
2017
+ export class Keypair {
2018
+
2019
+ static __wrap(ptr) {
2020
+ ptr = ptr >>> 0;
2021
+ const obj = Object.create(Keypair.prototype);
2022
+ obj.__wbg_ptr = ptr;
2023
+ KeypairFinalization.register(obj, obj.__wbg_ptr, obj);
2024
+ return obj;
2025
+ }
2026
+
2027
+ __destroy_into_raw() {
2028
+ const ptr = this.__wbg_ptr;
2029
+ this.__wbg_ptr = 0;
2030
+ KeypairFinalization.unregister(this);
2031
+ return ptr;
2032
+ }
2033
+
2034
+ free() {
2035
+ const ptr = this.__destroy_into_raw();
2036
+ wasm.__wbg_keypair_free(ptr, 0);
2037
+ }
2038
+ /**
2039
+ * Create a new `Keypair `
2040
+ */
2041
+ constructor() {
2042
+ const ret = wasm.keypair_constructor();
2043
+ this.__wbg_ptr = ret >>> 0;
2044
+ KeypairFinalization.register(this, this.__wbg_ptr, this);
2045
+ return this;
2046
+ }
2047
+ /**
2048
+ * Convert a `Keypair` to a `Uint8Array`
2049
+ * @returns {Uint8Array}
2050
+ */
2051
+ toBytes() {
2052
+ try {
2053
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2054
+ wasm.keypair_toBytes(retptr, this.__wbg_ptr);
2055
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2056
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2057
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
2058
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
2059
+ return v1;
2060
+ } finally {
2061
+ wasm.__wbindgen_add_to_stack_pointer(16);
2062
+ }
2063
+ }
2064
+ /**
2065
+ * Recover a `Keypair` from a `Uint8Array`
2066
+ * @param {Uint8Array} bytes
2067
+ * @returns {Keypair}
2068
+ */
2069
+ static fromBytes(bytes) {
2070
+ try {
2071
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2072
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
2073
+ const len0 = WASM_VECTOR_LEN;
2074
+ wasm.keypair_fromBytes(retptr, ptr0, len0);
2075
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2076
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2077
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2078
+ if (r2) {
2079
+ throw takeObject(r1);
2080
+ }
2081
+ return Keypair.__wrap(r0);
2082
+ } finally {
2083
+ wasm.__wbindgen_add_to_stack_pointer(16);
2084
+ }
2085
+ }
2086
+ /**
2087
+ * Return the `Pubkey` for this `Keypair`
2088
+ * @returns {Pubkey}
2089
+ */
2090
+ pubkey() {
2091
+ const ret = wasm.keypair_pubkey(this.__wbg_ptr);
2092
+ return Pubkey.__wrap(ret);
2093
+ }
2094
+ }
2095
+ if (Symbol.dispose) Keypair.prototype[Symbol.dispose] = Keypair.prototype.free;
2096
+
2097
+ const MessageFinalization = (typeof FinalizationRegistry === 'undefined')
2098
+ ? { register: () => {}, unregister: () => {} }
2099
+ : new FinalizationRegistry(ptr => wasm.__wbg_message_free(ptr >>> 0, 1));
2100
+ /**
2101
+ * wasm-bindgen version of the Message struct.
2102
+ * This duplication is required until https://github.com/rustwasm/wasm-bindgen/issues/3671
2103
+ * is fixed. This must not diverge from the regular non-wasm Message struct.
2104
+ */
2105
+ export class Message {
2106
+
2107
+ static __wrap(ptr) {
2108
+ ptr = ptr >>> 0;
2109
+ const obj = Object.create(Message.prototype);
2110
+ obj.__wbg_ptr = ptr;
2111
+ MessageFinalization.register(obj, obj.__wbg_ptr, obj);
2112
+ return obj;
2113
+ }
2114
+
2115
+ __destroy_into_raw() {
2116
+ const ptr = this.__wbg_ptr;
2117
+ this.__wbg_ptr = 0;
2118
+ MessageFinalization.unregister(this);
2119
+ return ptr;
2120
+ }
2121
+
2122
+ free() {
2123
+ const ptr = this.__destroy_into_raw();
2124
+ wasm.__wbg_message_free(ptr, 0);
2125
+ }
2126
+ /**
2127
+ * The id of a recent ledger entry.
2128
+ * @returns {Hash}
2129
+ */
2130
+ get recent_blockhash() {
2131
+ const ret = wasm.__wbg_get_message_recent_blockhash(this.__wbg_ptr);
2132
+ return Hash.__wrap(ret);
2133
+ }
2134
+ /**
2135
+ * The id of a recent ledger entry.
2136
+ * @param {Hash} arg0
2137
+ */
2138
+ set recent_blockhash(arg0) {
2139
+ _assertClass(arg0, Hash);
2140
+ var ptr0 = arg0.__destroy_into_raw();
2141
+ wasm.__wbg_set_message_recent_blockhash(this.__wbg_ptr, ptr0);
2142
+ }
2143
+ }
2144
+ if (Symbol.dispose) Message.prototype[Symbol.dispose] = Message.prototype.free;
2145
+
2146
+ const PubkeyFinalization = (typeof FinalizationRegistry === 'undefined')
2147
+ ? { register: () => {}, unregister: () => {} }
2148
+ : new FinalizationRegistry(ptr => wasm.__wbg_pubkey_free(ptr >>> 0, 1));
2149
+ /**
2150
+ * The address of a [Solana account][acc].
2151
+ *
2152
+ * Some account addresses are [ed25519] public keys, with corresponding secret
2153
+ * keys that are managed off-chain. Often, though, account addresses do not
2154
+ * have corresponding secret keys &mdash; as with [_program derived
2155
+ * addresses_][pdas] &mdash; or the secret key is not relevant to the operation
2156
+ * of a program, and may have even been disposed of. As running Solana programs
2157
+ * can not safely create or manage secret keys, the full [`Keypair`] is not
2158
+ * defined in `solana-program` but in `solana-sdk`.
2159
+ *
2160
+ * [acc]: https://solana.com/docs/core/accounts
2161
+ * [ed25519]: https://ed25519.cr.yp.to/
2162
+ * [pdas]: https://solana.com/docs/core/cpi#program-derived-addresses
2163
+ * [`Keypair`]: https://docs.rs/solana-sdk/latest/solana_sdk/signer/keypair/struct.Keypair.html
2164
+ */
2165
+ export class Pubkey {
2166
+
2167
+ static __wrap(ptr) {
2168
+ ptr = ptr >>> 0;
2169
+ const obj = Object.create(Pubkey.prototype);
2170
+ obj.__wbg_ptr = ptr;
2171
+ PubkeyFinalization.register(obj, obj.__wbg_ptr, obj);
2172
+ return obj;
2173
+ }
2174
+
2175
+ __destroy_into_raw() {
2176
+ const ptr = this.__wbg_ptr;
2177
+ this.__wbg_ptr = 0;
2178
+ PubkeyFinalization.unregister(this);
2179
+ return ptr;
2180
+ }
2181
+
2182
+ free() {
2183
+ const ptr = this.__destroy_into_raw();
2184
+ wasm.__wbg_pubkey_free(ptr, 0);
2185
+ }
2186
+ /**
2187
+ * Create a new Pubkey object
2188
+ *
2189
+ * * `value` - optional public key as a base58 encoded string, `Uint8Array`, `[number]`
2190
+ * @param {any} value
2191
+ */
2192
+ constructor(value) {
2193
+ try {
2194
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2195
+ wasm.pubkey_constructor(retptr, addHeapObject(value));
2196
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2197
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2198
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2199
+ if (r2) {
2200
+ throw takeObject(r1);
2201
+ }
2202
+ this.__wbg_ptr = r0 >>> 0;
2203
+ PubkeyFinalization.register(this, this.__wbg_ptr, this);
2204
+ return this;
2205
+ } finally {
2206
+ wasm.__wbindgen_add_to_stack_pointer(16);
2207
+ }
2208
+ }
2209
+ /**
2210
+ * Return the base58 string representation of the public key
2211
+ * @returns {string}
2212
+ */
2213
+ toString() {
2214
+ let deferred1_0;
2215
+ let deferred1_1;
2216
+ try {
2217
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2218
+ wasm.pubkey_toString(retptr, this.__wbg_ptr);
2219
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2220
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2221
+ deferred1_0 = r0;
2222
+ deferred1_1 = r1;
2223
+ return getStringFromWasm0(r0, r1);
2224
+ } finally {
2225
+ wasm.__wbindgen_add_to_stack_pointer(16);
2226
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
2227
+ }
2228
+ }
2229
+ /**
2230
+ * Check if a `Pubkey` is on the ed25519 curve.
2231
+ * @returns {boolean}
2232
+ */
2233
+ isOnCurve() {
2234
+ const ret = wasm.pubkey_isOnCurve(this.__wbg_ptr);
2235
+ return ret !== 0;
2236
+ }
2237
+ /**
2238
+ * Checks if two `Pubkey`s are equal
2239
+ * @param {Pubkey} other
2240
+ * @returns {boolean}
2241
+ */
2242
+ equals(other) {
2243
+ _assertClass(other, Pubkey);
2244
+ const ret = wasm.pubkey_equals(this.__wbg_ptr, other.__wbg_ptr);
2245
+ return ret !== 0;
2246
+ }
2247
+ /**
2248
+ * Return the `Uint8Array` representation of the public key
2249
+ * @returns {Uint8Array}
2250
+ */
2251
+ toBytes() {
2252
+ try {
2253
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2254
+ wasm.pubkey_toBytes(retptr, this.__wbg_ptr);
2255
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2256
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2257
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
2258
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
2259
+ return v1;
2260
+ } finally {
2261
+ wasm.__wbindgen_add_to_stack_pointer(16);
2262
+ }
2263
+ }
2264
+ /**
2265
+ * Derive a Pubkey from another Pubkey, string seed, and a program id
2266
+ * @param {Pubkey} base
2267
+ * @param {string} seed
2268
+ * @param {Pubkey} owner
2269
+ * @returns {Pubkey}
2270
+ */
2271
+ static createWithSeed(base, seed, owner) {
2272
+ try {
2273
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2274
+ _assertClass(base, Pubkey);
2275
+ const ptr0 = passStringToWasm0(seed, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2276
+ const len0 = WASM_VECTOR_LEN;
2277
+ _assertClass(owner, Pubkey);
2278
+ wasm.pubkey_createWithSeed(retptr, base.__wbg_ptr, ptr0, len0, owner.__wbg_ptr);
2279
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2280
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2281
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2282
+ if (r2) {
2283
+ throw takeObject(r1);
2284
+ }
2285
+ return Pubkey.__wrap(r0);
2286
+ } finally {
2287
+ wasm.__wbindgen_add_to_stack_pointer(16);
2288
+ }
2289
+ }
2290
+ /**
2291
+ * Derive a program address from seeds and a program id
2292
+ * @param {any[]} seeds
2293
+ * @param {Pubkey} program_id
2294
+ * @returns {Pubkey}
2295
+ */
2296
+ static createProgramAddress(seeds, program_id) {
2297
+ try {
2298
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2299
+ const ptr0 = passArrayJsValueToWasm0(seeds, wasm.__wbindgen_export);
2300
+ const len0 = WASM_VECTOR_LEN;
2301
+ _assertClass(program_id, Pubkey);
2302
+ wasm.pubkey_createProgramAddress(retptr, ptr0, len0, program_id.__wbg_ptr);
2303
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2304
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2305
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2306
+ if (r2) {
2307
+ throw takeObject(r1);
2308
+ }
2309
+ return Pubkey.__wrap(r0);
2310
+ } finally {
2311
+ wasm.__wbindgen_add_to_stack_pointer(16);
2312
+ }
2313
+ }
2314
+ /**
2315
+ * Find a valid program address
2316
+ *
2317
+ * Returns:
2318
+ * * `[PubKey, number]` - the program address and bump seed
2319
+ * @param {any[]} seeds
2320
+ * @param {Pubkey} program_id
2321
+ * @returns {any}
2322
+ */
2323
+ static findProgramAddress(seeds, program_id) {
2324
+ try {
2325
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2326
+ const ptr0 = passArrayJsValueToWasm0(seeds, wasm.__wbindgen_export);
2327
+ const len0 = WASM_VECTOR_LEN;
2328
+ _assertClass(program_id, Pubkey);
2329
+ wasm.pubkey_findProgramAddress(retptr, ptr0, len0, program_id.__wbg_ptr);
2330
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2331
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2332
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2333
+ if (r2) {
2334
+ throw takeObject(r1);
2335
+ }
2336
+ return takeObject(r0);
2337
+ } finally {
2338
+ wasm.__wbindgen_add_to_stack_pointer(16);
2339
+ }
2340
+ }
2341
+ }
2342
+ if (Symbol.dispose) Pubkey.prototype[Symbol.dispose] = Pubkey.prototype.free;
2343
+
2344
+ const SystemInstructionFinalization = (typeof FinalizationRegistry === 'undefined')
2345
+ ? { register: () => {}, unregister: () => {} }
2346
+ : new FinalizationRegistry(ptr => wasm.__wbg_systeminstruction_free(ptr >>> 0, 1));
2347
+
2348
+ export class SystemInstruction {
2349
+
2350
+ __destroy_into_raw() {
2351
+ const ptr = this.__wbg_ptr;
2352
+ this.__wbg_ptr = 0;
2353
+ SystemInstructionFinalization.unregister(this);
2354
+ return ptr;
2355
+ }
2356
+
2357
+ free() {
2358
+ const ptr = this.__destroy_into_raw();
2359
+ wasm.__wbg_systeminstruction_free(ptr, 0);
2360
+ }
2361
+ /**
2362
+ * @param {Pubkey} from_pubkey
2363
+ * @param {Pubkey} to_pubkey
2364
+ * @param {bigint} lamports
2365
+ * @param {bigint} space
2366
+ * @param {Pubkey} owner
2367
+ * @returns {Instruction}
2368
+ */
2369
+ static createAccount(from_pubkey, to_pubkey, lamports, space, owner) {
2370
+ _assertClass(from_pubkey, Pubkey);
2371
+ _assertClass(to_pubkey, Pubkey);
2372
+ _assertClass(owner, Pubkey);
2373
+ const ret = wasm.systeminstruction_createAccount(from_pubkey.__wbg_ptr, to_pubkey.__wbg_ptr, lamports, space, owner.__wbg_ptr);
2374
+ return Instruction.__wrap(ret);
2375
+ }
2376
+ /**
2377
+ * @param {Pubkey} from_pubkey
2378
+ * @param {Pubkey} to_pubkey
2379
+ * @param {Pubkey} base
2380
+ * @param {string} seed
2381
+ * @param {bigint} lamports
2382
+ * @param {bigint} space
2383
+ * @param {Pubkey} owner
2384
+ * @returns {Instruction}
2385
+ */
2386
+ static createAccountWithSeed(from_pubkey, to_pubkey, base, seed, lamports, space, owner) {
2387
+ _assertClass(from_pubkey, Pubkey);
2388
+ _assertClass(to_pubkey, Pubkey);
2389
+ _assertClass(base, Pubkey);
2390
+ const ptr0 = passStringToWasm0(seed, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2391
+ const len0 = WASM_VECTOR_LEN;
2392
+ _assertClass(owner, Pubkey);
2393
+ const ret = wasm.systeminstruction_createAccountWithSeed(from_pubkey.__wbg_ptr, to_pubkey.__wbg_ptr, base.__wbg_ptr, ptr0, len0, lamports, space, owner.__wbg_ptr);
2394
+ return Instruction.__wrap(ret);
2395
+ }
2396
+ /**
2397
+ * @param {Pubkey} pubkey
2398
+ * @param {Pubkey} owner
2399
+ * @returns {Instruction}
2400
+ */
2401
+ static assign(pubkey, owner) {
2402
+ _assertClass(pubkey, Pubkey);
2403
+ _assertClass(owner, Pubkey);
2404
+ const ret = wasm.systeminstruction_assign(pubkey.__wbg_ptr, owner.__wbg_ptr);
2405
+ return Instruction.__wrap(ret);
2406
+ }
2407
+ /**
2408
+ * @param {Pubkey} pubkey
2409
+ * @param {Pubkey} base
2410
+ * @param {string} seed
2411
+ * @param {Pubkey} owner
2412
+ * @returns {Instruction}
2413
+ */
2414
+ static assignWithSeed(pubkey, base, seed, owner) {
2415
+ _assertClass(pubkey, Pubkey);
2416
+ _assertClass(base, Pubkey);
2417
+ const ptr0 = passStringToWasm0(seed, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2418
+ const len0 = WASM_VECTOR_LEN;
2419
+ _assertClass(owner, Pubkey);
2420
+ const ret = wasm.systeminstruction_assignWithSeed(pubkey.__wbg_ptr, base.__wbg_ptr, ptr0, len0, owner.__wbg_ptr);
2421
+ return Instruction.__wrap(ret);
2422
+ }
2423
+ /**
2424
+ * @param {Pubkey} from_pubkey
2425
+ * @param {Pubkey} to_pubkey
2426
+ * @param {bigint} lamports
2427
+ * @returns {Instruction}
2428
+ */
2429
+ static transfer(from_pubkey, to_pubkey, lamports) {
2430
+ _assertClass(from_pubkey, Pubkey);
2431
+ _assertClass(to_pubkey, Pubkey);
2432
+ const ret = wasm.systeminstruction_transfer(from_pubkey.__wbg_ptr, to_pubkey.__wbg_ptr, lamports);
2433
+ return Instruction.__wrap(ret);
2434
+ }
2435
+ /**
2436
+ * @param {Pubkey} from_pubkey
2437
+ * @param {Pubkey} from_base
2438
+ * @param {string} from_seed
2439
+ * @param {Pubkey} from_owner
2440
+ * @param {Pubkey} to_pubkey
2441
+ * @param {bigint} lamports
2442
+ * @returns {Instruction}
2443
+ */
2444
+ static transferWithSeed(from_pubkey, from_base, from_seed, from_owner, to_pubkey, lamports) {
2445
+ _assertClass(from_pubkey, Pubkey);
2446
+ _assertClass(from_base, Pubkey);
2447
+ const ptr0 = passStringToWasm0(from_seed, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2448
+ const len0 = WASM_VECTOR_LEN;
2449
+ _assertClass(from_owner, Pubkey);
2450
+ _assertClass(to_pubkey, Pubkey);
2451
+ const ret = wasm.systeminstruction_transferWithSeed(from_pubkey.__wbg_ptr, from_base.__wbg_ptr, ptr0, len0, from_owner.__wbg_ptr, to_pubkey.__wbg_ptr, lamports);
2452
+ return Instruction.__wrap(ret);
2453
+ }
2454
+ /**
2455
+ * @param {Pubkey} pubkey
2456
+ * @param {bigint} space
2457
+ * @returns {Instruction}
2458
+ */
2459
+ static allocate(pubkey, space) {
2460
+ _assertClass(pubkey, Pubkey);
2461
+ const ret = wasm.systeminstruction_allocate(pubkey.__wbg_ptr, space);
2462
+ return Instruction.__wrap(ret);
2463
+ }
2464
+ /**
2465
+ * @param {Pubkey} address
2466
+ * @param {Pubkey} base
2467
+ * @param {string} seed
2468
+ * @param {bigint} space
2469
+ * @param {Pubkey} owner
2470
+ * @returns {Instruction}
2471
+ */
2472
+ static allocateWithSeed(address, base, seed, space, owner) {
2473
+ _assertClass(address, Pubkey);
2474
+ _assertClass(base, Pubkey);
2475
+ const ptr0 = passStringToWasm0(seed, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2476
+ const len0 = WASM_VECTOR_LEN;
2477
+ _assertClass(owner, Pubkey);
2478
+ const ret = wasm.systeminstruction_allocateWithSeed(address.__wbg_ptr, base.__wbg_ptr, ptr0, len0, space, owner.__wbg_ptr);
2479
+ return Instruction.__wrap(ret);
2480
+ }
2481
+ /**
2482
+ * @param {Pubkey} from_pubkey
2483
+ * @param {Pubkey} nonce_pubkey
2484
+ * @param {Pubkey} authority
2485
+ * @param {bigint} lamports
2486
+ * @returns {Array<any>}
2487
+ */
2488
+ static createNonceAccount(from_pubkey, nonce_pubkey, authority, lamports) {
2489
+ _assertClass(from_pubkey, Pubkey);
2490
+ _assertClass(nonce_pubkey, Pubkey);
2491
+ _assertClass(authority, Pubkey);
2492
+ const ret = wasm.systeminstruction_createNonceAccount(from_pubkey.__wbg_ptr, nonce_pubkey.__wbg_ptr, authority.__wbg_ptr, lamports);
2493
+ return takeObject(ret);
2494
+ }
2495
+ /**
2496
+ * @param {Pubkey} nonce_pubkey
2497
+ * @param {Pubkey} authorized_pubkey
2498
+ * @returns {Instruction}
2499
+ */
2500
+ static advanceNonceAccount(nonce_pubkey, authorized_pubkey) {
2501
+ _assertClass(nonce_pubkey, Pubkey);
2502
+ _assertClass(authorized_pubkey, Pubkey);
2503
+ const ret = wasm.systeminstruction_advanceNonceAccount(nonce_pubkey.__wbg_ptr, authorized_pubkey.__wbg_ptr);
2504
+ return Instruction.__wrap(ret);
2505
+ }
2506
+ /**
2507
+ * @param {Pubkey} nonce_pubkey
2508
+ * @param {Pubkey} authorized_pubkey
2509
+ * @param {Pubkey} to_pubkey
2510
+ * @param {bigint} lamports
2511
+ * @returns {Instruction}
2512
+ */
2513
+ static withdrawNonceAccount(nonce_pubkey, authorized_pubkey, to_pubkey, lamports) {
2514
+ _assertClass(nonce_pubkey, Pubkey);
2515
+ _assertClass(authorized_pubkey, Pubkey);
2516
+ _assertClass(to_pubkey, Pubkey);
2517
+ const ret = wasm.systeminstruction_withdrawNonceAccount(nonce_pubkey.__wbg_ptr, authorized_pubkey.__wbg_ptr, to_pubkey.__wbg_ptr, lamports);
2518
+ return Instruction.__wrap(ret);
2519
+ }
2520
+ /**
2521
+ * @param {Pubkey} nonce_pubkey
2522
+ * @param {Pubkey} authorized_pubkey
2523
+ * @param {Pubkey} new_authority
2524
+ * @returns {Instruction}
2525
+ */
2526
+ static authorizeNonceAccount(nonce_pubkey, authorized_pubkey, new_authority) {
2527
+ _assertClass(nonce_pubkey, Pubkey);
2528
+ _assertClass(authorized_pubkey, Pubkey);
2529
+ _assertClass(new_authority, Pubkey);
2530
+ const ret = wasm.systeminstruction_authorizeNonceAccount(nonce_pubkey.__wbg_ptr, authorized_pubkey.__wbg_ptr, new_authority.__wbg_ptr);
2531
+ return Instruction.__wrap(ret);
2532
+ }
2533
+ }
2534
+ if (Symbol.dispose) SystemInstruction.prototype[Symbol.dispose] = SystemInstruction.prototype.free;
2535
+
2536
+ const TransactionFinalization = (typeof FinalizationRegistry === 'undefined')
2537
+ ? { register: () => {}, unregister: () => {} }
2538
+ : new FinalizationRegistry(ptr => wasm.__wbg_transaction_free(ptr >>> 0, 1));
2539
+ /**
2540
+ * wasm-bindgen version of the Transaction struct.
2541
+ * This duplication is required until https://github.com/rustwasm/wasm-bindgen/issues/3671
2542
+ * is fixed. This must not diverge from the regular non-wasm Transaction struct.
2543
+ */
2544
+ export class Transaction {
2545
+
2546
+ static __wrap(ptr) {
2547
+ ptr = ptr >>> 0;
2548
+ const obj = Object.create(Transaction.prototype);
2549
+ obj.__wbg_ptr = ptr;
2550
+ TransactionFinalization.register(obj, obj.__wbg_ptr, obj);
2551
+ return obj;
2552
+ }
2553
+
2554
+ __destroy_into_raw() {
2555
+ const ptr = this.__wbg_ptr;
2556
+ this.__wbg_ptr = 0;
2557
+ TransactionFinalization.unregister(this);
2558
+ return ptr;
2559
+ }
2560
+
2561
+ free() {
2562
+ const ptr = this.__destroy_into_raw();
2563
+ wasm.__wbg_transaction_free(ptr, 0);
2564
+ }
2565
+ /**
2566
+ * Create a new `Transaction`
2567
+ * @param {Instructions} instructions
2568
+ * @param {Pubkey | null} [payer]
2569
+ */
2570
+ constructor(instructions, payer) {
2571
+ _assertClass(instructions, Instructions);
2572
+ var ptr0 = instructions.__destroy_into_raw();
2573
+ let ptr1 = 0;
2574
+ if (!isLikeNone(payer)) {
2575
+ _assertClass(payer, Pubkey);
2576
+ ptr1 = payer.__destroy_into_raw();
2577
+ }
2578
+ const ret = wasm.transaction_constructor(ptr0, ptr1);
2579
+ this.__wbg_ptr = ret >>> 0;
2580
+ TransactionFinalization.register(this, this.__wbg_ptr, this);
2581
+ return this;
2582
+ }
2583
+ /**
2584
+ * Return a message containing all data that should be signed.
2585
+ * @returns {Message}
2586
+ */
2587
+ message() {
2588
+ const ret = wasm.transaction_message(this.__wbg_ptr);
2589
+ return Message.__wrap(ret);
2590
+ }
2591
+ /**
2592
+ * Return the serialized message data to sign.
2593
+ * @returns {Uint8Array}
2594
+ */
2595
+ messageData() {
2596
+ try {
2597
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2598
+ wasm.transaction_messageData(retptr, this.__wbg_ptr);
2599
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2600
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2601
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
2602
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
2603
+ return v1;
2604
+ } finally {
2605
+ wasm.__wbindgen_add_to_stack_pointer(16);
2606
+ }
2607
+ }
2608
+ /**
2609
+ * Verify the transaction
2610
+ */
2611
+ verify() {
2612
+ try {
2613
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2614
+ wasm.transaction_verify(retptr, this.__wbg_ptr);
2615
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2616
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2617
+ if (r1) {
2618
+ throw takeObject(r0);
2619
+ }
2620
+ } finally {
2621
+ wasm.__wbindgen_add_to_stack_pointer(16);
2622
+ }
2623
+ }
2624
+ /**
2625
+ * @param {Keypair} keypair
2626
+ * @param {Hash} recent_blockhash
2627
+ */
2628
+ partialSign(keypair, recent_blockhash) {
2629
+ _assertClass(keypair, Keypair);
2630
+ _assertClass(recent_blockhash, Hash);
2631
+ wasm.transaction_partialSign(this.__wbg_ptr, keypair.__wbg_ptr, recent_blockhash.__wbg_ptr);
2632
+ }
2633
+ /**
2634
+ * @returns {boolean}
2635
+ */
2636
+ isSigned() {
2637
+ const ret = wasm.transaction_isSigned(this.__wbg_ptr);
2638
+ return ret !== 0;
2639
+ }
2640
+ /**
2641
+ * @returns {Uint8Array}
2642
+ */
2643
+ toBytes() {
2644
+ try {
2645
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2646
+ wasm.transaction_toBytes(retptr, this.__wbg_ptr);
2647
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2648
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2649
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
2650
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
2651
+ return v1;
2652
+ } finally {
2653
+ wasm.__wbindgen_add_to_stack_pointer(16);
2654
+ }
2655
+ }
2656
+ /**
2657
+ * @param {Uint8Array} bytes
2658
+ * @returns {Transaction}
2659
+ */
2660
+ static fromBytes(bytes) {
2661
+ try {
2662
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2663
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
2664
+ const len0 = WASM_VECTOR_LEN;
2665
+ wasm.transaction_fromBytes(retptr, ptr0, len0);
2666
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2667
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2668
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2669
+ if (r2) {
2670
+ throw takeObject(r1);
2671
+ }
2672
+ return Transaction.__wrap(r0);
2673
+ } finally {
2674
+ wasm.__wbindgen_add_to_stack_pointer(16);
2675
+ }
2676
+ }
2677
+ }
2678
+ if (Symbol.dispose) Transaction.prototype[Symbol.dispose] = Transaction.prototype.free;
2679
+
1759
2680
  export function __wbg_Error_e83987f665cf5504(arg0, arg1) {
1760
2681
  const ret = Error(getStringFromWasm0(arg0, arg1));
1761
2682
  return addHeapObject(ret);
@@ -1856,16 +2777,91 @@ export function __wbg___wbindgen_throw_b855445ff6a94295(arg0, arg1) {
1856
2777
  throw new Error(getStringFromWasm0(arg0, arg1));
1857
2778
  };
1858
2779
 
2780
+ export function __wbg__wbg_cb_unref_2454a539ea5790d9(arg0) {
2781
+ getObject(arg0)._wbg_cb_unref();
2782
+ };
2783
+
2784
+ export function __wbg_abort_28ad55c5825b004d(arg0, arg1) {
2785
+ getObject(arg0).abort(getObject(arg1));
2786
+ };
2787
+
2788
+ export function __wbg_abort_e7eb059f72f9ed0c(arg0) {
2789
+ getObject(arg0).abort();
2790
+ };
2791
+
2792
+ export function __wbg_append_b577eb3a177bc0fa() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2793
+ getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
2794
+ }, arguments) };
2795
+
2796
+ export function __wbg_arrayBuffer_b375eccb84b4ddf3() { return handleError(function (arg0) {
2797
+ const ret = getObject(arg0).arrayBuffer();
2798
+ return addHeapObject(ret);
2799
+ }, arguments) };
2800
+
2801
+ export function __wbg_call_525440f72fbfc0ea() { return handleError(function (arg0, arg1, arg2) {
2802
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
2803
+ return addHeapObject(ret);
2804
+ }, arguments) };
2805
+
1859
2806
  export function __wbg_call_e762c39fa8ea36bf() { return handleError(function (arg0, arg1) {
1860
2807
  const ret = getObject(arg0).call(getObject(arg1));
1861
2808
  return addHeapObject(ret);
1862
2809
  }, arguments) };
1863
2810
 
2811
+ export function __wbg_clearTimeout_7a42b49784aea641(arg0) {
2812
+ const ret = clearTimeout(takeObject(arg0));
2813
+ return addHeapObject(ret);
2814
+ };
2815
+
2816
+ export function __wbg_crypto_038798f665f985e2(arg0) {
2817
+ const ret = getObject(arg0).crypto;
2818
+ return addHeapObject(ret);
2819
+ };
2820
+
2821
+ export function __wbg_debug_f4b0c59db649db48(arg0) {
2822
+ console.debug(getObject(arg0));
2823
+ };
2824
+
1864
2825
  export function __wbg_done_2042aa2670fb1db1(arg0) {
1865
2826
  const ret = getObject(arg0).done;
1866
2827
  return ret;
1867
2828
  };
1868
2829
 
2830
+ export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
2831
+ let deferred0_0;
2832
+ let deferred0_1;
2833
+ try {
2834
+ deferred0_0 = arg0;
2835
+ deferred0_1 = arg1;
2836
+ console.error(getStringFromWasm0(arg0, arg1));
2837
+ } finally {
2838
+ wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
2839
+ }
2840
+ };
2841
+
2842
+ export function __wbg_error_a7f8fbb0523dae15(arg0) {
2843
+ console.error(getObject(arg0));
2844
+ };
2845
+
2846
+ export function __wbg_fetch_74a3e84ebd2c9a0e(arg0) {
2847
+ const ret = fetch(getObject(arg0));
2848
+ return addHeapObject(ret);
2849
+ };
2850
+
2851
+ export function __wbg_fetch_f8ba0e29a9d6de0d(arg0, arg1) {
2852
+ const ret = getObject(arg0).fetch(getObject(arg1));
2853
+ return addHeapObject(ret);
2854
+ };
2855
+
2856
+ export function __wbg_getRandomValues_371e7ade8bd92088(arg0, arg1) {
2857
+ getObject(arg0).getRandomValues(getObject(arg1));
2858
+ };
2859
+
2860
+ export function __wbg_getRandomValues_7dfe5bd1b67c9ca1(arg0) {
2861
+ const ret = getObject(arg0).getRandomValues;
2862
+ return addHeapObject(ret);
2863
+ };
2864
+
1869
2865
  export function __wbg_get_7bed016f185add81(arg0, arg1) {
1870
2866
  const ret = getObject(arg0)[arg1 >>> 0];
1871
2867
  return addHeapObject(ret);
@@ -1886,6 +2882,20 @@ export function __wbg_get_with_ref_key_6550b2c093d2eb18(arg0, arg1) {
1886
2882
  return addHeapObject(ret);
1887
2883
  };
1888
2884
 
2885
+ export function __wbg_has_787fafc980c3ccdb() { return handleError(function (arg0, arg1) {
2886
+ const ret = Reflect.has(getObject(arg0), getObject(arg1));
2887
+ return ret;
2888
+ }, arguments) };
2889
+
2890
+ export function __wbg_headers_b87d7eaba61c3278(arg0) {
2891
+ const ret = getObject(arg0).headers;
2892
+ return addHeapObject(ret);
2893
+ };
2894
+
2895
+ export function __wbg_info_e674a11f4f50cc0c(arg0) {
2896
+ console.info(getObject(arg0));
2897
+ };
2898
+
1889
2899
  export function __wbg_instanceof_ArrayBuffer_70beb1189ca63b38(arg0) {
1890
2900
  let result;
1891
2901
  try {
@@ -1897,6 +2907,17 @@ export function __wbg_instanceof_ArrayBuffer_70beb1189ca63b38(arg0) {
1897
2907
  return ret;
1898
2908
  };
1899
2909
 
2910
+ export function __wbg_instanceof_Response_f4f3e87e07f3135c(arg0) {
2911
+ let result;
2912
+ try {
2913
+ result = getObject(arg0) instanceof Response;
2914
+ } catch (_) {
2915
+ result = false;
2916
+ }
2917
+ const ret = result;
2918
+ return ret;
2919
+ };
2920
+
1900
2921
  export function __wbg_instanceof_Uint8Array_20c8e73002f7af98(arg0) {
1901
2922
  let result;
1902
2923
  try {
@@ -1908,6 +2929,11 @@ export function __wbg_instanceof_Uint8Array_20c8e73002f7af98(arg0) {
1908
2929
  return ret;
1909
2930
  };
1910
2931
 
2932
+ export function __wbg_instruction_new(arg0) {
2933
+ const ret = Instruction.__wrap(arg0);
2934
+ return addHeapObject(ret);
2935
+ };
2936
+
1911
2937
  export function __wbg_isArray_643fafc484312e19(arg0) {
1912
2938
  const ret = Array.isArray(getObject(arg0));
1913
2939
  return ret;
@@ -1938,16 +2964,89 @@ export function __wbg_length_cdd215e10d9dd507(arg0) {
1938
2964
  return ret;
1939
2965
  };
1940
2966
 
2967
+ export function __wbg_log_8cec76766b8c0e33(arg0) {
2968
+ console.log(getObject(arg0));
2969
+ };
2970
+
2971
+ export function __wbg_msCrypto_ff35fce085fab2a3(arg0) {
2972
+ const ret = getObject(arg0).msCrypto;
2973
+ return addHeapObject(ret);
2974
+ };
2975
+
1941
2976
  export function __wbg_new_1acc0b6eea89d040() {
1942
2977
  const ret = new Object();
1943
2978
  return addHeapObject(ret);
1944
2979
  };
1945
2980
 
2981
+ export function __wbg_new_2531773dac38ebb3() { return handleError(function () {
2982
+ const ret = new AbortController();
2983
+ return addHeapObject(ret);
2984
+ }, arguments) };
2985
+
2986
+ export function __wbg_new_3c3d849046688a66(arg0, arg1) {
2987
+ try {
2988
+ var state0 = {a: arg0, b: arg1};
2989
+ var cb0 = (arg0, arg1) => {
2990
+ const a = state0.a;
2991
+ state0.a = 0;
2992
+ try {
2993
+ return __wasm_bindgen_func_elem_480(a, state0.b, arg0, arg1);
2994
+ } finally {
2995
+ state0.a = a;
2996
+ }
2997
+ };
2998
+ const ret = new Promise(cb0);
2999
+ return addHeapObject(ret);
3000
+ } finally {
3001
+ state0.a = state0.b = 0;
3002
+ }
3003
+ };
3004
+
1946
3005
  export function __wbg_new_5a79be3ab53b8aa5(arg0) {
1947
3006
  const ret = new Uint8Array(getObject(arg0));
1948
3007
  return addHeapObject(ret);
1949
3008
  };
1950
3009
 
3010
+ export function __wbg_new_8a6f238a6ece86ea() {
3011
+ const ret = new Error();
3012
+ return addHeapObject(ret);
3013
+ };
3014
+
3015
+ export function __wbg_new_9edf9838a2def39c() { return handleError(function () {
3016
+ const ret = new Headers();
3017
+ return addHeapObject(ret);
3018
+ }, arguments) };
3019
+
3020
+ export function __wbg_new_e17d9f43105b08be() {
3021
+ const ret = new Array();
3022
+ return addHeapObject(ret);
3023
+ };
3024
+
3025
+ export function __wbg_new_from_slice_92f4d78ca282a2d2(arg0, arg1) {
3026
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
3027
+ return addHeapObject(ret);
3028
+ };
3029
+
3030
+ export function __wbg_new_no_args_ee98eee5275000a4(arg0, arg1) {
3031
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
3032
+ return addHeapObject(ret);
3033
+ };
3034
+
3035
+ export function __wbg_new_with_length_01aa0dc35aa13543(arg0) {
3036
+ const ret = new Uint8Array(arg0 >>> 0);
3037
+ return addHeapObject(ret);
3038
+ };
3039
+
3040
+ export function __wbg_new_with_length_31d2669cb75c5215(arg0) {
3041
+ const ret = new Array(arg0 >>> 0);
3042
+ return addHeapObject(ret);
3043
+ };
3044
+
3045
+ export function __wbg_new_with_str_and_init_0ae7728b6ec367b1() { return handleError(function (arg0, arg1, arg2) {
3046
+ const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
3047
+ return addHeapObject(ret);
3048
+ }, arguments) };
3049
+
1951
3050
  export function __wbg_next_020810e0ae8ebcb0() { return handleError(function (arg0) {
1952
3051
  const ret = getObject(arg0).next();
1953
3052
  return addHeapObject(ret);
@@ -1962,15 +3061,179 @@ export function __wbg_prototypesetcall_2a6620b6922694b2(arg0, arg1, arg2) {
1962
3061
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
1963
3062
  };
1964
3063
 
3064
+ export function __wbg_pubkey_new(arg0) {
3065
+ const ret = Pubkey.__wrap(arg0);
3066
+ return addHeapObject(ret);
3067
+ };
3068
+
3069
+ export function __wbg_push_df81a39d04db858c(arg0, arg1) {
3070
+ const ret = getObject(arg0).push(getObject(arg1));
3071
+ return ret;
3072
+ };
3073
+
3074
+ export function __wbg_queueMicrotask_34d692c25c47d05b(arg0) {
3075
+ const ret = getObject(arg0).queueMicrotask;
3076
+ return addHeapObject(ret);
3077
+ };
3078
+
3079
+ export function __wbg_queueMicrotask_9d76cacb20c84d58(arg0) {
3080
+ queueMicrotask(getObject(arg0));
3081
+ };
3082
+
3083
+ export function __wbg_randomFillSync_994ac6d9ade7a695(arg0, arg1, arg2) {
3084
+ getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
3085
+ };
3086
+
3087
+ export function __wbg_require_0d6aeaec3c042c88(arg0, arg1, arg2) {
3088
+ const ret = getObject(arg0).require(getStringFromWasm0(arg1, arg2));
3089
+ return addHeapObject(ret);
3090
+ };
3091
+
3092
+ export function __wbg_resolve_caf97c30b83f7053(arg0) {
3093
+ const ret = Promise.resolve(getObject(arg0));
3094
+ return addHeapObject(ret);
3095
+ };
3096
+
3097
+ export function __wbg_self_25aabeb5a7b41685() { return handleError(function () {
3098
+ const ret = self.self;
3099
+ return addHeapObject(ret);
3100
+ }, arguments) };
3101
+
3102
+ export function __wbg_setTimeout_7bb3429662ab1e70(arg0, arg1) {
3103
+ const ret = setTimeout(getObject(arg0), arg1);
3104
+ return addHeapObject(ret);
3105
+ };
3106
+
1965
3107
  export function __wbg_set_3807d5f0bfc24aa7(arg0, arg1, arg2) {
1966
3108
  getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
1967
3109
  };
1968
3110
 
3111
+ export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
3112
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
3113
+ };
3114
+
3115
+ export function __wbg_set_body_3c365989753d61f4(arg0, arg1) {
3116
+ getObject(arg0).body = getObject(arg1);
3117
+ };
3118
+
3119
+ export function __wbg_set_c213c871859d6500(arg0, arg1, arg2) {
3120
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
3121
+ };
3122
+
3123
+ export function __wbg_set_cache_2f9deb19b92b81e3(arg0, arg1) {
3124
+ getObject(arg0).cache = __wbindgen_enum_RequestCache[arg1];
3125
+ };
3126
+
3127
+ export function __wbg_set_credentials_f621cd2d85c0c228(arg0, arg1) {
3128
+ getObject(arg0).credentials = __wbindgen_enum_RequestCredentials[arg1];
3129
+ };
3130
+
3131
+ export function __wbg_set_headers_6926da238cd32ee4(arg0, arg1) {
3132
+ getObject(arg0).headers = getObject(arg1);
3133
+ };
3134
+
3135
+ export function __wbg_set_method_c02d8cbbe204ac2d(arg0, arg1, arg2) {
3136
+ getObject(arg0).method = getStringFromWasm0(arg1, arg2);
3137
+ };
3138
+
3139
+ export function __wbg_set_mode_52ef73cfa79639cb(arg0, arg1) {
3140
+ getObject(arg0).mode = __wbindgen_enum_RequestMode[arg1];
3141
+ };
3142
+
3143
+ export function __wbg_set_signal_dda2cf7ccb6bee0f(arg0, arg1) {
3144
+ getObject(arg0).signal = getObject(arg1);
3145
+ };
3146
+
3147
+ export function __wbg_signal_4db5aa055bf9eb9a(arg0) {
3148
+ const ret = getObject(arg0).signal;
3149
+ return addHeapObject(ret);
3150
+ };
3151
+
3152
+ export function __wbg_stack_0ed75d68575b0f3c(arg0, arg1) {
3153
+ const ret = getObject(arg1).stack;
3154
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
3155
+ const len1 = WASM_VECTOR_LEN;
3156
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
3157
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
3158
+ };
3159
+
3160
+ export function __wbg_static_accessor_GLOBAL_89e1d9ac6a1b250e() {
3161
+ const ret = typeof global === 'undefined' ? null : global;
3162
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
3163
+ };
3164
+
3165
+ export function __wbg_static_accessor_GLOBAL_THIS_8b530f326a9e48ac() {
3166
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
3167
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
3168
+ };
3169
+
3170
+ export function __wbg_static_accessor_MODULE_ef3aa2eb251158a5() {
3171
+ const ret = module;
3172
+ return addHeapObject(ret);
3173
+ };
3174
+
3175
+ export function __wbg_static_accessor_SELF_6fdf4b64710cc91b() {
3176
+ const ret = typeof self === 'undefined' ? null : self;
3177
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
3178
+ };
3179
+
3180
+ export function __wbg_static_accessor_WINDOW_b45bfc5a37f6cfa2() {
3181
+ const ret = typeof window === 'undefined' ? null : window;
3182
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
3183
+ };
3184
+
3185
+ export function __wbg_status_de7eed5a7a5bfd5d(arg0) {
3186
+ const ret = getObject(arg0).status;
3187
+ return ret;
3188
+ };
3189
+
3190
+ export function __wbg_stringify_b5fb28f6465d9c3e() { return handleError(function (arg0) {
3191
+ const ret = JSON.stringify(getObject(arg0));
3192
+ return addHeapObject(ret);
3193
+ }, arguments) };
3194
+
3195
+ export function __wbg_subarray_480600f3d6a9f26c(arg0, arg1, arg2) {
3196
+ const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
3197
+ return addHeapObject(ret);
3198
+ };
3199
+
3200
+ export function __wbg_text_dc33c15c17bdfb52() { return handleError(function (arg0) {
3201
+ const ret = getObject(arg0).text();
3202
+ return addHeapObject(ret);
3203
+ }, arguments) };
3204
+
3205
+ export function __wbg_then_4f46f6544e6b4a28(arg0, arg1) {
3206
+ const ret = getObject(arg0).then(getObject(arg1));
3207
+ return addHeapObject(ret);
3208
+ };
3209
+
3210
+ export function __wbg_then_70d05cf780a18d77(arg0, arg1, arg2) {
3211
+ const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
3212
+ return addHeapObject(ret);
3213
+ };
3214
+
3215
+ export function __wbg_url_b36d2a5008eb056f(arg0, arg1) {
3216
+ const ret = getObject(arg1).url;
3217
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
3218
+ const len1 = WASM_VECTOR_LEN;
3219
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
3220
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
3221
+ };
3222
+
1969
3223
  export function __wbg_value_692627309814bb8c(arg0) {
1970
3224
  const ret = getObject(arg0).value;
1971
3225
  return addHeapObject(ret);
1972
3226
  };
1973
3227
 
3228
+ export function __wbg_values_58a781304289144d(arg0) {
3229
+ const ret = getObject(arg0).values();
3230
+ return addHeapObject(ret);
3231
+ };
3232
+
3233
+ export function __wbg_warn_1d74dddbe2fd1dbb(arg0) {
3234
+ console.warn(getObject(arg0));
3235
+ };
3236
+
1974
3237
  export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
1975
3238
  // Cast intrinsic for `Ref(String) -> Externref`.
1976
3239
  const ret = getStringFromWasm0(arg0, arg1);
@@ -1983,12 +3246,24 @@ export function __wbindgen_cast_4625c577ab2ec9ee(arg0) {
1983
3246
  return addHeapObject(ret);
1984
3247
  };
1985
3248
 
3249
+ export function __wbindgen_cast_7f6d2ab049d5d8fd(arg0, arg1) {
3250
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 334, function: Function { arguments: [], shim_idx: 335, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3251
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_3093, __wasm_bindgen_func_elem_3097);
3252
+ return addHeapObject(ret);
3253
+ };
3254
+
1986
3255
  export function __wbindgen_cast_9ae0607507abb057(arg0) {
1987
3256
  // Cast intrinsic for `I64 -> Externref`.
1988
3257
  const ret = arg0;
1989
3258
  return addHeapObject(ret);
1990
3259
  };
1991
3260
 
3261
+ export function __wbindgen_cast_b2b7ff753c8c06bb(arg0, arg1) {
3262
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 366, function: Function { arguments: [Externref], shim_idx: 361, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3263
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_3222, __wasm_bindgen_func_elem_3203);
3264
+ return addHeapObject(ret);
3265
+ };
3266
+
1992
3267
  export function __wbindgen_cast_d6cd19b81560fd6e(arg0) {
1993
3268
  // Cast intrinsic for `F64 -> Externref`.
1994
3269
  const ret = arg0;