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