@velocity-exchange/sdk 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/CHANGELOG.md +7 -44
  2. package/lib/browser/adminClient.d.ts +0 -1
  3. package/lib/browser/bankrun/bankrunConnection.d.ts +2 -1
  4. package/lib/browser/bankrun/bankrunConnection.js +23 -1
  5. package/lib/browser/constants/numericConstants.d.ts +2 -1
  6. package/lib/browser/constants/numericConstants.js +8 -4
  7. package/lib/browser/constants/spotMarkets.d.ts +0 -1
  8. package/lib/browser/core/VelocityCore.d.ts +0 -1
  9. package/lib/browser/core/instructions/deposit.d.ts +0 -1
  10. package/lib/browser/core/instructions/withdraw.d.ts +0 -1
  11. package/lib/browser/dlob/DLOB.d.ts +0 -1
  12. package/lib/browser/dlob/DLOBNode.d.ts +0 -1
  13. package/lib/browser/dlob/DLOBSubscriber.d.ts +0 -1
  14. package/lib/browser/dlob/NodeList.d.ts +0 -1
  15. package/lib/browser/dlob/orderBookLevels.d.ts +0 -1
  16. package/lib/browser/events/eventList.d.ts +3 -3
  17. package/lib/browser/events/eventsServerLogProvider.d.ts +1 -1
  18. package/lib/browser/events/pollingLogProvider.d.ts +1 -1
  19. package/lib/browser/events/txEventCache.d.ts +3 -3
  20. package/lib/browser/events/webSocketLogProvider.d.ts +1 -1
  21. package/lib/browser/factory/bigNum.d.ts +0 -1
  22. package/lib/browser/index.d.ts +1 -1
  23. package/lib/browser/indicative-quotes/indicativeQuotesSender.d.ts +0 -1
  24. package/lib/browser/jupiter/jupiterClient.d.ts +0 -1
  25. package/lib/browser/marginCalculation.d.ts +0 -1
  26. package/lib/browser/marinade/index.d.ts +2 -3
  27. package/lib/browser/marinade/index.js +5 -0
  28. package/lib/browser/math/amm.d.ts +0 -1
  29. package/lib/browser/math/auction.d.ts +0 -1
  30. package/lib/browser/math/conversion.d.ts +0 -1
  31. package/lib/browser/math/funding.d.ts +0 -1
  32. package/lib/browser/math/insurance.d.ts +0 -1
  33. package/lib/browser/math/liquidation.d.ts +0 -1
  34. package/lib/browser/math/margin.d.ts +0 -1
  35. package/lib/browser/math/market.d.ts +0 -1
  36. package/lib/browser/math/oracles.d.ts +0 -1
  37. package/lib/browser/math/orders.d.ts +0 -1
  38. package/lib/browser/math/position.d.ts +1 -2
  39. package/lib/browser/math/repeg.d.ts +0 -1
  40. package/lib/browser/math/spotBalance.d.ts +0 -1
  41. package/lib/browser/math/spotMarket.d.ts +0 -1
  42. package/lib/browser/math/spotPosition.d.ts +0 -1
  43. package/lib/browser/math/state.d.ts +0 -1
  44. package/lib/browser/math/superStake.d.ts +0 -1
  45. package/lib/browser/math/trade.d.ts +2 -3
  46. package/lib/browser/math/utils.d.ts +0 -1
  47. package/lib/browser/oracles/oracleClientCache.d.ts +1 -1
  48. package/lib/browser/oracles/pythClient.d.ts +0 -1
  49. package/lib/browser/oracles/pythLazerClient.d.ts +0 -1
  50. package/lib/browser/oracles/strictOraclePrice.d.ts +0 -1
  51. package/lib/browser/oracles/types.d.ts +0 -1
  52. package/lib/browser/oracles/utils.d.ts +0 -1
  53. package/lib/browser/orderParams.d.ts +0 -1
  54. package/lib/browser/swap/UnifiedSwapClient.d.ts +0 -1
  55. package/lib/browser/titan/titanClient.d.ts +0 -1
  56. package/lib/browser/tokenFaucet.d.ts +0 -1
  57. package/lib/browser/tx/txHandler.d.ts +2 -2
  58. package/lib/browser/types.d.ts +2 -3
  59. package/lib/browser/user.d.ts +0 -1
  60. package/lib/browser/velocityClient.d.ts +1 -2
  61. package/lib/node/adminClient.d.ts +0 -1
  62. package/lib/node/adminClient.d.ts.map +1 -1
  63. package/lib/node/bankrun/bankrunConnection.d.ts +2 -1
  64. package/lib/node/bankrun/bankrunConnection.d.ts.map +1 -1
  65. package/lib/node/bankrun/bankrunConnection.js +23 -1
  66. package/lib/node/constants/numericConstants.d.ts +2 -1
  67. package/lib/node/constants/numericConstants.d.ts.map +1 -1
  68. package/lib/node/constants/numericConstants.js +8 -4
  69. package/lib/node/constants/spotMarkets.d.ts +0 -1
  70. package/lib/node/constants/spotMarkets.d.ts.map +1 -1
  71. package/lib/node/core/VelocityCore.d.ts +0 -1
  72. package/lib/node/core/VelocityCore.d.ts.map +1 -1
  73. package/lib/node/core/instructions/deposit.d.ts +0 -1
  74. package/lib/node/core/instructions/deposit.d.ts.map +1 -1
  75. package/lib/node/core/instructions/withdraw.d.ts +0 -1
  76. package/lib/node/core/instructions/withdraw.d.ts.map +1 -1
  77. package/lib/node/dlob/DLOB.d.ts +0 -1
  78. package/lib/node/dlob/DLOB.d.ts.map +1 -1
  79. package/lib/node/dlob/DLOBNode.d.ts +0 -1
  80. package/lib/node/dlob/DLOBNode.d.ts.map +1 -1
  81. package/lib/node/dlob/DLOBSubscriber.d.ts +0 -1
  82. package/lib/node/dlob/DLOBSubscriber.d.ts.map +1 -1
  83. package/lib/node/dlob/NodeList.d.ts +0 -1
  84. package/lib/node/dlob/NodeList.d.ts.map +1 -1
  85. package/lib/node/dlob/orderBookLevels.d.ts +0 -1
  86. package/lib/node/dlob/orderBookLevels.d.ts.map +1 -1
  87. package/lib/node/factory/bigNum.d.ts +0 -1
  88. package/lib/node/factory/bigNum.d.ts.map +1 -1
  89. package/lib/node/index.d.ts +1 -1
  90. package/lib/node/index.d.ts.map +1 -1
  91. package/lib/node/indicative-quotes/indicativeQuotesSender.d.ts +0 -1
  92. package/lib/node/indicative-quotes/indicativeQuotesSender.d.ts.map +1 -1
  93. package/lib/node/jupiter/jupiterClient.d.ts +0 -1
  94. package/lib/node/jupiter/jupiterClient.d.ts.map +1 -1
  95. package/lib/node/marginCalculation.d.ts +0 -1
  96. package/lib/node/marginCalculation.d.ts.map +1 -1
  97. package/lib/node/marinade/index.d.ts +2 -3
  98. package/lib/node/marinade/index.d.ts.map +1 -1
  99. package/lib/node/marinade/index.js +5 -0
  100. package/lib/node/math/amm.d.ts +0 -1
  101. package/lib/node/math/amm.d.ts.map +1 -1
  102. package/lib/node/math/auction.d.ts +0 -1
  103. package/lib/node/math/auction.d.ts.map +1 -1
  104. package/lib/node/math/conversion.d.ts +0 -1
  105. package/lib/node/math/conversion.d.ts.map +1 -1
  106. package/lib/node/math/funding.d.ts +0 -1
  107. package/lib/node/math/funding.d.ts.map +1 -1
  108. package/lib/node/math/insurance.d.ts +0 -1
  109. package/lib/node/math/insurance.d.ts.map +1 -1
  110. package/lib/node/math/liquidation.d.ts +0 -1
  111. package/lib/node/math/liquidation.d.ts.map +1 -1
  112. package/lib/node/math/margin.d.ts +0 -1
  113. package/lib/node/math/margin.d.ts.map +1 -1
  114. package/lib/node/math/market.d.ts +0 -1
  115. package/lib/node/math/market.d.ts.map +1 -1
  116. package/lib/node/math/oracles.d.ts +0 -1
  117. package/lib/node/math/oracles.d.ts.map +1 -1
  118. package/lib/node/math/orders.d.ts +0 -1
  119. package/lib/node/math/orders.d.ts.map +1 -1
  120. package/lib/node/math/position.d.ts +0 -1
  121. package/lib/node/math/position.d.ts.map +1 -1
  122. package/lib/node/math/repeg.d.ts +0 -1
  123. package/lib/node/math/repeg.d.ts.map +1 -1
  124. package/lib/node/math/spotBalance.d.ts +0 -1
  125. package/lib/node/math/spotBalance.d.ts.map +1 -1
  126. package/lib/node/math/spotMarket.d.ts +0 -1
  127. package/lib/node/math/spotMarket.d.ts.map +1 -1
  128. package/lib/node/math/spotPosition.d.ts +0 -1
  129. package/lib/node/math/spotPosition.d.ts.map +1 -1
  130. package/lib/node/math/state.d.ts +0 -1
  131. package/lib/node/math/state.d.ts.map +1 -1
  132. package/lib/node/math/superStake.d.ts +0 -1
  133. package/lib/node/math/superStake.d.ts.map +1 -1
  134. package/lib/node/math/trade.d.ts +0 -1
  135. package/lib/node/math/trade.d.ts.map +1 -1
  136. package/lib/node/math/utils.d.ts +0 -1
  137. package/lib/node/math/utils.d.ts.map +1 -1
  138. package/lib/node/oracles/pythClient.d.ts +0 -1
  139. package/lib/node/oracles/pythClient.d.ts.map +1 -1
  140. package/lib/node/oracles/pythLazerClient.d.ts +0 -1
  141. package/lib/node/oracles/pythLazerClient.d.ts.map +1 -1
  142. package/lib/node/oracles/strictOraclePrice.d.ts +0 -1
  143. package/lib/node/oracles/strictOraclePrice.d.ts.map +1 -1
  144. package/lib/node/oracles/types.d.ts +0 -1
  145. package/lib/node/oracles/types.d.ts.map +1 -1
  146. package/lib/node/oracles/utils.d.ts +0 -1
  147. package/lib/node/oracles/utils.d.ts.map +1 -1
  148. package/lib/node/orderParams.d.ts +0 -1
  149. package/lib/node/orderParams.d.ts.map +1 -1
  150. package/lib/node/swap/UnifiedSwapClient.d.ts +0 -1
  151. package/lib/node/swap/UnifiedSwapClient.d.ts.map +1 -1
  152. package/lib/node/titan/titanClient.d.ts +0 -1
  153. package/lib/node/titan/titanClient.d.ts.map +1 -1
  154. package/lib/node/tokenFaucet.d.ts +0 -1
  155. package/lib/node/tokenFaucet.d.ts.map +1 -1
  156. package/lib/node/types.d.ts +0 -1
  157. package/lib/node/types.d.ts.map +1 -1
  158. package/lib/node/user.d.ts +0 -1
  159. package/lib/node/user.d.ts.map +1 -1
  160. package/lib/node/velocityClient.d.ts +0 -1
  161. package/lib/node/velocityClient.d.ts.map +1 -1
  162. package/package.json +16 -11
  163. package/src/bankrun/bankrunConnection.ts +27 -1
  164. package/src/constants/numericConstants.ts +6 -2
  165. package/src/index.ts +5 -1
  166. package/src/marinade/index.ts +11 -2
  167. package/src/userMap/referrerMap.ts +1 -1
  168. package/src/userMap/revenueShareEscrowMap.ts +2 -2
  169. package/tests/VelocityCore/remainingAccounts.test.ts +4 -5
  170. package/tests/accounts/customizedCadenceBulkAccountLoader.test.ts +19 -11
  171. package/tests/amm/test.ts +162 -95
  172. package/tests/decode/userAccountBufferStrings.ts +100 -100
  173. package/tests/dlob/helpers.ts +156 -172
  174. package/tests/dlob/test.ts +155 -106
  175. package/tests/tx/TransactionConfirmationManager.test.ts +9 -2
  176. package/tests/user/getMarginCalculation.ts +1 -1
  177. package/tests/user/helpers.ts +3 -4
  178. package/tests/user/marginCalculations.test.ts +2 -2
  179. package/tests/user/test.ts +3 -3
  180. package/tsconfig.browser.json +3 -1
  181. package/tsconfig.json +20 -2
  182. package/.yarn/install-state.gz +0 -0
  183. package/VERSION +0 -1
  184. package/bun.lock +0 -1907
  185. package/scripts/updateVersion.js +0 -28
  186. package/tests/decode/phoenix.ts +0 -71
package/CHANGELOG.md CHANGED
@@ -1,50 +1,13 @@
1
- # Changelog
1
+ # @velocity-exchange/sdk
2
2
 
3
- ## [0.2.0](https://github.com/drift-labs/protocol-v2-shadow/compare/sdk-v0.1.0...sdk-v0.2.0) (2026-06-18)
3
+ ## 0.2.2
4
4
 
5
+ ### Patch Changes
5
6
 
6
- ### Features
7
+ - [#97](https://github.com/drift-labs/protocol-v2-shadow/pull/97) [`022a949`](https://github.com/drift-labs/protocol-v2-shadow/commit/022a949cb1802171ca57a61260f86c8908f94f34) Thanks [@ChewingGlass](https://github.com/ChewingGlass)! - Re-export `PriceUpdateAccount` from the package root and declare `@types/node` as a devDependency (fixes the SDK build under isolated installs). Enables downstream apps (dlob-server, keeper-bots-v2) to consume the velocity SDK without reaching into subpaths.
7
8
 
8
- * better fee collection and distribution architecture ([1999fbe](https://github.com/drift-labs/protocol-v2-shadow/commit/1999fbef3fcb81878dc56f510f06e28588cd1c40))
9
- * funding bias spread multiplier ([d7eb00c](https://github.com/drift-labs/protocol-v2-shadow/commit/d7eb00caa82b351f515b65dc4a7315a969059d91))
10
- * withdraw guard threshold to have a notional limit ([be33e8e](https://github.com/drift-labs/protocol-v2-shadow/commit/be33e8ed48cc319846d0896e435ed61050fc6a86))
9
+ ## 0.2.1
11
10
 
11
+ ### Patch Changes
12
12
 
13
- ### Refactors
14
-
15
- * enable strict mode in SDK and fix initial strict errors ([#74](https://github.com/drift-labs/protocol-v2-shadow/issues/74)) ([5e045d8](https://github.com/drift-labs/protocol-v2-shadow/commit/5e045d8a7ca3a599420d3583975ddaab610a780e))
16
- * fix remaining strict errors and enable strict mode in SDK ([#78](https://github.com/drift-labs/protocol-v2-shadow/issues/78)) ([1fb7c07](https://github.com/drift-labs/protocol-v2-shadow/commit/1fb7c07ad95b696ecd09605358d86df3ef5d1102))
17
-
18
- ## [0.1.0](https://github.com/drift-labs/protocol-v2-shadow/compare/sdk-v0.0.5...sdk-v0.1.0) (2026-06-11)
19
-
20
-
21
- ### Features
22
-
23
- * add builder codes on non swift ([#68](https://github.com/drift-labs/protocol-v2-shadow/issues/68)) ([2df4034](https://github.com/drift-labs/protocol-v2-shadow/commit/2df4034b2162f0df060b21453a16566f9de24f4f))
24
- * add transfer deposit by delegate ([16386ca](https://github.com/drift-labs/protocol-v2-shadow/commit/16386cad98a2a48d9a8a249ff75c9ce646e9fcac))
25
- * decouple AMM from rest of codebase ([84aba6d](https://github.com/drift-labs/protocol-v2-shadow/commit/84aba6d0c17ef97069185d82b74671bde6619919))
26
- * rebrand drift to velocity ([9c330b1](https://github.com/drift-labs/protocol-v2-shadow/commit/9c330b17cda7170482cc8b75ad3d1b3c137a8d32))
27
-
28
-
29
- ### Bug Fixes
30
-
31
- * resolve eslint unused-var and prettier formatting failures ([a3a1e3e](https://github.com/drift-labs/protocol-v2-shadow/commit/a3a1e3e1cbf68f35a7c39ea335927d0136c5bce1))
32
-
33
-
34
- ### Refactors
35
-
36
- * gather vAMM and hedge into a single VLP module ([905edc3](https://github.com/drift-labs/protocol-v2-shadow/commit/905edc338b453a1ce0ebb4dd9a13be97c66aa66d))
37
-
38
- ## [0.0.5](https://github.com/drift-labs/protocol-v2-shadow/compare/sdk-v0.0.4...sdk-v0.0.5) (2026-05-28)
39
-
40
-
41
- ### Refactors
42
-
43
- * increase oracle_price_offset to i64 ([#51](https://github.com/drift-labs/protocol-v2-shadow/issues/51)) ([d04039a](https://github.com/drift-labs/protocol-v2-shadow/commit/d04039a22b2ff37d05afd8fe271b9913d66689e1))
44
-
45
- ## [0.0.4](https://github.com/drift-labs/protocol-v2-shadow/compare/sdk-v0.0.3...sdk-v0.0.4) (2026-05-28)
46
-
47
-
48
- ### Refactors
49
-
50
- * increase oracle_price_offset to i64 ([#51](https://github.com/drift-labs/protocol-v2-shadow/issues/51)) ([d04039a](https://github.com/drift-labs/protocol-v2-shadow/commit/d04039a22b2ff37d05afd8fe271b9913d66689e1))
13
+ - [`4fd7462`](https://github.com/drift-labs/protocol-v2-shadow/commit/4fd7462bfa3c55e31e3457b1b65f519cf052a6fa) Thanks [@ChewingGlass](https://github.com/ChewingGlass)! - Testing new changelog based package publishing flow
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  /**
3
2
  * AdminClient — governance and protocol administration instruction builders.
4
3
  * Extends {@link VelocityClient}; all trading/keeper methods are also available.
@@ -1,6 +1,5 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
- /// <reference types="bn.js" />
4
3
  import { AccountInfo, Keypair, PublicKey, Transaction, RpcResponseAndContext, Commitment, TransactionSignature, SignatureStatusConfig, SignatureStatus, GetVersionedTransactionConfig, GetTransactionConfig, VersionedTransaction, SimulateTransactionConfig, SimulatedTransactionResponse, TransactionError, SignatureResultCallback, Connection as SolanaConnection, Blockhash, LogsFilter, LogsCallback, AccountChangeCallback, AddressLookupTableAccount } from '@solana/web3.js';
5
4
  import { ProgramTestContext, BanksClient } from 'solana-bankrun';
6
5
  import { BankrunProvider } from 'anchor-bankrun';
@@ -44,6 +43,8 @@ export declare class BankrunConnection {
44
43
  getSlot(): Promise<bigint>;
45
44
  toConnection(): SolanaConnection;
46
45
  getTokenAccount(publicKey: PublicKey): Promise<Account>;
46
+ getTokenAccountBalance(publicKey: PublicKey, _commitment?: Commitment): Promise<Account>;
47
+ getBalance(publicKey: PublicKey): Promise<bigint>;
47
48
  getMultipleAccountsInfo(publicKeys: PublicKey[], _commitmentOrConfig?: Commitment): Promise<(AccountInfo<Buffer> | null)[]>;
48
49
  getAccountInfo(publicKey: PublicKey): Promise<null | AccountInfo<Buffer>>;
49
50
  getAccountInfoAndContext(publicKey: PublicKey, _commitment?: Commitment): Promise<RpcResponseAndContext<null | AccountInfo<Buffer>>>;
@@ -106,6 +106,17 @@ class BankrunConnection {
106
106
  }
107
107
  return (0, spl_token_1.unpackAccount)(publicKey, info, info.owner);
108
108
  }
109
+ // Mirrors the drift-vaults bankrun helper: returns the decoded SPL token
110
+ // Account (with .amount), not web3.js's { value: { amount } } shape. The
111
+ // vaults tests read `.amount` off the result directly.
112
+ async getTokenAccountBalance(publicKey, _commitment) {
113
+ return this.getTokenAccount(publicKey);
114
+ }
115
+ // SOL lamport balance, straight off the BanksClient. Returns a bigint like
116
+ // the drift-vaults bankrun helper (callers wrap with Number()).
117
+ async getBalance(publicKey) {
118
+ return this._banksClient.getBalance(publicKey);
119
+ }
109
120
  async getMultipleAccountsInfo(publicKeys, _commitmentOrConfig) {
110
121
  const accountInfos = [];
111
122
  for (const publicKey of publicKeys) {
@@ -124,7 +135,18 @@ class BankrunConnection {
124
135
  async sendRawTransaction(rawTransaction,
125
136
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
126
137
  _options) {
127
- const tx = web3_js_1.Transaction.from(rawTransaction);
138
+ // Raw bytes may encode either a legacy or a versioned (v0) transaction.
139
+ // sendTransaction handles both, but they must be deserialized with the
140
+ // matching type: legacy parses with Transaction.from, versioned needs
141
+ // VersionedTransaction.deserialize. Versioned-tx clients (e.g. the vaults
142
+ // VaultClient) always send v0, so fall back when the legacy parse throws.
143
+ let tx;
144
+ try {
145
+ tx = web3_js_1.Transaction.from(rawTransaction);
146
+ }
147
+ catch (e) {
148
+ tx = web3_js_1.VersionedTransaction.deserialize(rawTransaction);
149
+ }
128
150
  const signature = await this.sendTransaction(tx);
129
151
  return signature;
130
152
  }
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { BN } from '../isomorphic/anchor';
3
2
  export declare const ZERO: BN;
4
3
  export declare const ONE: BN;
@@ -13,6 +12,7 @@ export declare const NINE: BN;
13
12
  export declare const TEN: BN;
14
13
  export declare const TEN_THOUSAND: BN;
15
14
  export declare const BN_MAX: BN;
15
+ export declare const TEN_MILLION: BN;
16
16
  export declare const MAX_LEVERAGE: BN;
17
17
  export declare const MAX_LEVERAGE_ORDER_SIZE: BN;
18
18
  export declare const PERCENTAGE_PRECISION_EXP: BN;
@@ -68,4 +68,5 @@ export declare const IDLE_TIME_SLOTS = 9000;
68
68
  export declare const SLOT_TIME_ESTIMATE_MS = 400;
69
69
  export declare const DUST_POSITION_SIZE: BN;
70
70
  export declare const GET_MULTIPLE_ACCOUNTS_CHUNK_SIZE = 99;
71
+ export declare const MAX_I64: BN;
71
72
  export declare const MIN_I64: BN;
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BID_ASK_SPREAD_PRECISION = exports.MARGIN_PRECISION = exports.AMM_TIMES_PEG_TO_QUOTE_PRECISION_RATIO = exports.PRICE_TO_QUOTE_PRECISION = exports.PRICE_DIV_PEG = exports.AMM_TO_QUOTE_PRECISION_RATIO = exports.BASE_PRECISION_EXP = exports.BASE_PRECISION = exports.AMM_RESERVE_PRECISION = exports.PEG_PRECISION = exports.FUNDING_RATE_BUFFER_PRECISION = exports.FUNDING_RATE_PRECISION = exports.PRICE_PRECISION = exports.QUOTE_PRECISION = exports.LIQUIDATION_FEE_PRECISION = exports.SPOT_MARKET_IMF_PRECISION = exports.SPOT_MARKET_IMF_PRECISION_EXP = exports.SPOT_MARKET_BALANCE_PRECISION = exports.SPOT_MARKET_BALANCE_PRECISION_EXP = exports.SPOT_MARKET_WEIGHT_PRECISION = exports.SPOT_MARKET_UTILIZATION_PRECISION = exports.SPOT_MARKET_UTILIZATION_PRECISION_EXP = exports.SPOT_MARKET_CUMULATIVE_INTEREST_PRECISION = exports.SPOT_MARKET_CUMULATIVE_INTEREST_PRECISION_EXP = exports.SPOT_MARKET_RATE_PRECISION = exports.SPOT_MARKET_RATE_PRECISION_EXP = exports.AMM_RESERVE_PRECISION_EXP = exports.PEG_PRECISION_EXP = exports.FUNDING_RATE_PRECISION_EXP = exports.PRICE_PRECISION_EXP = exports.FUNDING_RATE_BUFFER_PRECISION_EXP = exports.QUOTE_PRECISION_EXP = exports.CONCENTRATION_PRECISION = exports.PERCENTAGE_PRECISION = exports.PERCENTAGE_PRECISION_EXP = exports.MAX_LEVERAGE_ORDER_SIZE = exports.MAX_LEVERAGE = exports.BN_MAX = exports.TEN_THOUSAND = exports.TEN = exports.NINE = exports.EIGHT = exports.SEVEN = exports.SIX = exports.FIVE = exports.FOUR = exports.THREE = exports.TWO = exports.ONE = exports.ZERO = void 0;
4
- exports.MIN_I64 = exports.GET_MULTIPLE_ACCOUNTS_CHUNK_SIZE = exports.DUST_POSITION_SIZE = exports.SLOT_TIME_ESTIMATE_MS = exports.IDLE_TIME_SLOTS = exports.ACCOUNT_AGE_DELETION_CUTOFF_SECONDS = exports.DEFAULT_REVENUE_SINCE_LAST_FUNDING_SPREAD_RETREAT = exports.OPEN_ORDER_MARGIN_REQUIREMENT = exports.LAMPORTS_EXP = exports.LAMPORTS_PRECISION = exports.QUOTE_SPOT_MARKET_INDEX = exports.ONE_YEAR = exports.ONE_HOUR = exports.FIVE_MINUTE = exports.PRICE_TIMES_AMM_TO_QUOTE_PRECISION_RATIO = exports.FUNDING_RATE_CLAMP_DENOMINATOR = exports.FUNDING_RATE_OFFSET_PERCENTAGE = exports.FUNDING_RATE_OFFSET_DENOMINATOR = exports.LIQUIDATION_PCT_PRECISION = void 0;
3
+ exports.MARGIN_PRECISION = exports.AMM_TIMES_PEG_TO_QUOTE_PRECISION_RATIO = exports.PRICE_TO_QUOTE_PRECISION = exports.PRICE_DIV_PEG = exports.AMM_TO_QUOTE_PRECISION_RATIO = exports.BASE_PRECISION_EXP = exports.BASE_PRECISION = exports.AMM_RESERVE_PRECISION = exports.PEG_PRECISION = exports.FUNDING_RATE_BUFFER_PRECISION = exports.FUNDING_RATE_PRECISION = exports.PRICE_PRECISION = exports.QUOTE_PRECISION = exports.LIQUIDATION_FEE_PRECISION = exports.SPOT_MARKET_IMF_PRECISION = exports.SPOT_MARKET_IMF_PRECISION_EXP = exports.SPOT_MARKET_BALANCE_PRECISION = exports.SPOT_MARKET_BALANCE_PRECISION_EXP = exports.SPOT_MARKET_WEIGHT_PRECISION = exports.SPOT_MARKET_UTILIZATION_PRECISION = exports.SPOT_MARKET_UTILIZATION_PRECISION_EXP = exports.SPOT_MARKET_CUMULATIVE_INTEREST_PRECISION = exports.SPOT_MARKET_CUMULATIVE_INTEREST_PRECISION_EXP = exports.SPOT_MARKET_RATE_PRECISION = exports.SPOT_MARKET_RATE_PRECISION_EXP = exports.AMM_RESERVE_PRECISION_EXP = exports.PEG_PRECISION_EXP = exports.FUNDING_RATE_PRECISION_EXP = exports.PRICE_PRECISION_EXP = exports.FUNDING_RATE_BUFFER_PRECISION_EXP = exports.QUOTE_PRECISION_EXP = exports.CONCENTRATION_PRECISION = exports.PERCENTAGE_PRECISION = exports.PERCENTAGE_PRECISION_EXP = exports.MAX_LEVERAGE_ORDER_SIZE = exports.MAX_LEVERAGE = exports.TEN_MILLION = exports.BN_MAX = exports.TEN_THOUSAND = exports.TEN = exports.NINE = exports.EIGHT = exports.SEVEN = exports.SIX = exports.FIVE = exports.FOUR = exports.THREE = exports.TWO = exports.ONE = exports.ZERO = void 0;
4
+ exports.MIN_I64 = exports.MAX_I64 = exports.GET_MULTIPLE_ACCOUNTS_CHUNK_SIZE = exports.DUST_POSITION_SIZE = exports.SLOT_TIME_ESTIMATE_MS = exports.IDLE_TIME_SLOTS = exports.ACCOUNT_AGE_DELETION_CUTOFF_SECONDS = exports.DEFAULT_REVENUE_SINCE_LAST_FUNDING_SPREAD_RETREAT = exports.OPEN_ORDER_MARGIN_REQUIREMENT = exports.LAMPORTS_EXP = exports.LAMPORTS_PRECISION = exports.QUOTE_SPOT_MARKET_INDEX = exports.ONE_YEAR = exports.ONE_HOUR = exports.FIVE_MINUTE = exports.PRICE_TIMES_AMM_TO_QUOTE_PRECISION_RATIO = exports.FUNDING_RATE_CLAMP_DENOMINATOR = exports.FUNDING_RATE_OFFSET_PERCENTAGE = exports.FUNDING_RATE_OFFSET_DENOMINATOR = exports.LIQUIDATION_PCT_PRECISION = exports.BID_ASK_SPREAD_PRECISION = void 0;
5
5
  const web3_js_1 = require("@solana/web3.js");
6
6
  const anchor_1 = require("../isomorphic/anchor");
7
- const bigNum_1 = require("../factory/bigNum");
8
7
  exports.ZERO = new anchor_1.BN(0);
9
8
  exports.ONE = new anchor_1.BN(1);
10
9
  exports.TWO = new anchor_1.BN(2);
@@ -18,6 +17,7 @@ exports.NINE = new anchor_1.BN(9);
18
17
  exports.TEN = new anchor_1.BN(10);
19
18
  exports.TEN_THOUSAND = new anchor_1.BN(10000);
20
19
  exports.BN_MAX = new anchor_1.BN(Number.MAX_SAFE_INTEGER);
20
+ exports.TEN_MILLION = exports.TEN_THOUSAND.mul(exports.TEN_THOUSAND);
21
21
  exports.MAX_LEVERAGE = new anchor_1.BN(5);
22
22
  exports.MAX_LEVERAGE_ORDER_SIZE = new anchor_1.BN('18446744073709551615');
23
23
  exports.PERCENTAGE_PRECISION_EXP = new anchor_1.BN(6);
@@ -74,4 +74,8 @@ exports.SLOT_TIME_ESTIMATE_MS = 400;
74
74
  exports.DUST_POSITION_SIZE = exports.QUOTE_PRECISION.divn(100); // Dust position is any position smaller than 1c
75
75
  exports.GET_MULTIPLE_ACCOUNTS_CHUNK_SIZE = 99;
76
76
  // integer constants
77
- exports.MIN_I64 = bigNum_1.BigNum.fromPrint('-9223372036854775808').val;
77
+ // Built with `BN` directly (not `BigNum.fromPrint`) to avoid a module-load
78
+ // circular dependency: `bigNum.ts` imports `ZERO` from this file, so importing
79
+ // `bigNum.ts` first leaves `BigNum` undefined while this module body evaluates.
80
+ exports.MAX_I64 = new anchor_1.BN('9223372036854775807');
81
+ exports.MIN_I64 = new anchor_1.BN('-9223372036854775808');
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { PublicKey } from '@solana/web3.js';
3
2
  import { OracleSource } from '../types';
4
3
  import { BN } from '../isomorphic/anchor';
@@ -1,6 +1,5 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
- /// <reference types="bn.js" />
4
3
  import type { AccountMeta, Connection, PublicKey, TransactionInstruction } from '@solana/web3.js';
5
4
  import * as pdas from '../addresses/pda';
6
5
  import * as constants from '../constants';
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import type { AccountMeta, PublicKey, TransactionInstruction } from '@solana/web3.js';
3
2
  import type { BN } from '../../isomorphic/anchor';
4
3
  import type { VelocityProgram } from '../../config';
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import type { AccountMeta, PublicKey, TransactionInstruction } from '@solana/web3.js';
3
2
  import type { BN } from '../../isomorphic/anchor';
4
3
  import type { VelocityProgram } from '../../config';
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  /**
3
2
  * DLOB — Decentralized Limit Order Book.
4
3
  *
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { BN } from '../isomorphic/anchor';
3
2
  import { MarketTypeStr, Order } from '../types';
4
3
  import { MMOraclePriceData, OraclePriceData } from '../oracles/types';
@@ -1,5 +1,4 @@
1
1
  /// <reference types="node" />
2
- /// <reference types="bn.js" />
3
2
  import { DLOB } from './DLOB';
4
3
  import { EventEmitter } from 'events';
5
4
  import StrictEventEmitter from 'strict-event-emitter-types';
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { MarketTypeStr, Order } from '../types';
3
2
  import { DLOBNode, DLOBNodeMap } from './DLOBNode';
4
3
  import { BN } from '../isomorphic/anchor';
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { BN } from '../isomorphic/anchor';
3
2
  import { DLOBNode } from './DLOBNode';
4
3
  import { PerpMarketAccount } from '../types';
@@ -1,9 +1,9 @@
1
1
  import { EventType, EventMap, EventSubscriptionOrderDirection, SortFn } from './types';
2
2
  declare class Node<Type extends EventType, Event extends EventMap[Type]> {
3
3
  event: Event;
4
- next?: Node<Type, Event>;
5
- prev?: Node<Type, Event>;
6
- constructor(event: Event, next?: Node<Type, Event>, prev?: Node<Type, Event>);
4
+ next?: Node<Type, Event> | undefined;
5
+ prev?: Node<Type, Event> | undefined;
6
+ constructor(event: Event, next?: Node<Type, Event> | undefined, prev?: Node<Type, Event> | undefined);
7
7
  }
8
8
  export declare class EventList<Type extends EventType> {
9
9
  eventType: Type;
@@ -13,7 +13,7 @@ export declare class EventsServerLogProvider implements LogProvider {
13
13
  private timeoutId?;
14
14
  private reconnectAttempts;
15
15
  eventEmitter: EventEmitter;
16
- constructor(url: string, eventTypes: EventType[], userAccount?: string);
16
+ constructor(url: string, eventTypes: EventType[], userAccount?: string | undefined);
17
17
  isSubscribed(): boolean;
18
18
  subscribe(callback: logProviderCallback): Promise<boolean>;
19
19
  unsubscribe(external?: boolean): Promise<boolean>;
@@ -10,7 +10,7 @@ export declare class PollingLogProvider implements LogProvider {
10
10
  private mostRecentSeenTx?;
11
11
  private mutex;
12
12
  private firstFetch;
13
- constructor(connection: Connection, address: PublicKey, commitment: Commitment, frequency?: number, batchSize?: number);
13
+ constructor(connection: Connection, address: PublicKey, commitment: Commitment, frequency?: number, batchSize?: number | undefined);
14
14
  subscribe(callback: logProviderCallback, skipHistory?: boolean): Promise<boolean>;
15
15
  isSubscribed(): boolean;
16
16
  unsubscribe(): Promise<boolean>;
@@ -2,9 +2,9 @@ import { WrappedEvent, EventType } from './types';
2
2
  declare class Node {
3
3
  key: string;
4
4
  value: WrappedEvent<EventType>[];
5
- next?: Node;
6
- prev?: Node;
7
- constructor(key: string, value: WrappedEvent<EventType>[], next?: Node, prev?: Node);
5
+ next?: Node | undefined;
6
+ prev?: Node | undefined;
7
+ constructor(key: string, value: WrappedEvent<EventType>[], next?: Node | undefined, prev?: Node | undefined);
8
8
  }
9
9
  export declare class TxEventCache {
10
10
  maxTx: number;
@@ -15,7 +15,7 @@ export declare class WebSocketLogProvider implements LogProvider {
15
15
  private reconnectAttempts;
16
16
  eventEmitter?: EventEmitter;
17
17
  private callback?;
18
- constructor(connection: Connection, address: PublicKey, commitment: Commitment, resubTimeoutMs?: number);
18
+ constructor(connection: Connection, address: PublicKey, commitment: Commitment, resubTimeoutMs?: number | undefined);
19
19
  subscribe(callback: logProviderCallback): Promise<boolean>;
20
20
  setSubscription(callback: logProviderCallback): void;
21
21
  isSubscribed(): boolean;
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { BN } from '../isomorphic/anchor';
3
2
  export declare class BigNum {
4
3
  val: BN;
@@ -43,7 +43,7 @@ export * from './accounts/types';
43
43
  export * from './addresses/pda';
44
44
  export * from './adminClient';
45
45
  export * from './assert/assert';
46
- export { PythLazerSubscriber, type PythLazerPriceFeedArray } from './pyth';
46
+ export { PythLazerSubscriber, type PythLazerPriceFeedArray, type PriceUpdateAccount, } from './pyth';
47
47
  export * from './testClient';
48
48
  export * from './user';
49
49
  export * from './userConfig';
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { Keypair } from '@solana/web3.js';
3
2
  import { BN } from '../isomorphic/anchor';
4
3
  type Quote = {
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { AddressLookupTableAccount, Connection, PublicKey, TransactionInstruction, TransactionMessage, VersionedTransaction } from '@solana/web3.js';
3
2
  import { BN } from '../isomorphic/anchor';
4
3
  import { SwapMode } from '../swap/UnifiedSwapClient';
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { BN } from './isomorphic/anchor';
3
2
  import { MarketType } from './types';
4
3
  export type MarginCategory = 'Initial' | 'Maintenance' | 'Fill';
@@ -1,8 +1,7 @@
1
- /// <reference types="bn.js" />
2
- import { AnchorProvider, BN, Program } from '../isomorphic/anchor29';
1
+ import { BN, Program } from '../isomorphic/anchor29';
3
2
  import { MarinadeFinance } from './types';
4
3
  import { PublicKey, TransactionInstruction } from '@solana/web3.js';
5
- export declare function getMarinadeFinanceProgram(provider: AnchorProvider): Program<MarinadeFinance>;
4
+ export declare function getMarinadeFinanceProgram(provider: unknown): Program<MarinadeFinance>;
6
5
  export declare function getMarinadeDepositIx({ program, amount, mSOLAccount, transferFrom, }: {
7
6
  amount: BN;
8
7
  mSOLAccount: PublicKey;
@@ -6,6 +6,11 @@ const types_1 = require("./types");
6
6
  const web3_js_1 = require("@solana/web3.js");
7
7
  const spl_token_1 = require("@solana/spl-token");
8
8
  const marinadeFinanceProgramId = new web3_js_1.PublicKey('MarBmsSgKXdrN1egZf5sqe1TMai9K1rChYNDJgjq7aD');
9
+ // The Marinade SDK is built against anchor 0.29 (3-arg `new Program`), so the
10
+ // provider is typed against the anchor29 shim. Callers hold an anchor 1.0
11
+ // AnchorProvider, which is runtime-compatible but nominally distinct — accept it
12
+ // loosely and narrow at the construction boundary rather than leaking the cast to
13
+ // every call site.
9
14
  function getMarinadeFinanceProgram(provider) {
10
15
  return new anchor29_1.Program(types_1.IDL, marinadeFinanceProgramId, provider);
11
16
  }
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { BN } from '../isomorphic/anchor';
3
2
  import { AMM, MarketStats, PositionDirection, SwapDirection, PerpMarketAccount } from '../types';
4
3
  import { MMOraclePriceData, OraclePriceData } from '../oracles/types';
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { Order, PositionDirection, StateAccount } from '../types';
3
2
  import { BN } from '../isomorphic/anchor';
4
3
  import { PerpMarketAccount } from '../types';
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { BN } from '../isomorphic/anchor';
3
2
  export declare const convertToNumber: (bigNumber: BN, precision?: BN) => number;
4
3
  export declare function convertToBN(value: number, precision: BN): BN;
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { BN } from '../isomorphic/anchor';
3
2
  import { PerpMarketAccount } from '../types';
4
3
  import { MMOraclePriceData, OraclePriceData } from '../oracles/types';
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { BN } from '../isomorphic/anchor';
3
2
  import { SpotMarketAccount } from '../types';
4
3
  export declare function nextRevenuePoolSettleApr(spotMarket: SpotMarketAccount, vaultBalance: BN, // vault token amount
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { BN } from '../isomorphic/anchor';
3
2
  export declare function calculateBaseAssetAmountToCoverMarginShortage(marginShortage: BN, marginRatio: number, liquidationFee: number, ifLiquidationFee: number, oraclePrice: BN, quoteOraclePrice: BN): BN | undefined;
4
3
  export declare function calculateLiabilityTransferToCoverMarginShortage(marginShortage: BN, assetWeight: number, assetLiquidationMultiplier: number, liabilityWeight: number, liabilityLiquidationMultiplier: number, liabilityDecimals: number, liabilityPrice: BN, ifLiquidationFee: number): BN | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { BN } from '../isomorphic/anchor';
3
2
  import { OraclePriceData } from '../oracles/types';
4
3
  import { VelocityClient } from '../velocityClient';
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { BN } from '../isomorphic/anchor';
3
2
  import { PerpMarketAccount, MarginCategory, SpotMarketAccount } from '../types';
4
3
  import { MMOraclePriceData, OraclePriceData } from '../oracles/types';
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { HistoricalOracleData, MarketStats, OracleGuardRails, OracleSource, OracleValidity, PerpMarketAccount } from '../types';
3
2
  import { OraclePriceData } from '../oracles/types';
4
3
  import { BN } from '../isomorphic/anchor';
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { PerpMarketAccount, AMM, MarketStats, Order, PositionDirection, MarketTypeStr, StateAccount } from '../types';
3
2
  import { BN } from '../isomorphic/anchor';
4
3
  import { MMOraclePriceData, OraclePriceData } from '../oracles/types';
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { BN } from '../isomorphic/anchor';
3
2
  import { MMOraclePriceData, OraclePriceData } from '../oracles/types';
4
3
  import { PerpMarketAccount, PositionDirection, PerpPosition, SpotMarketAccount } from '../types';
@@ -20,7 +19,7 @@ export declare function calculateBaseAssetValue(market: PerpMarketAccount, userP
20
19
  * @param oraclePriceData
21
20
  * @returns BaseAssetAmount : Precision QUOTE_PRECISION
22
21
  */
23
- export declare function calculatePositionPNL(market: PerpMarketAccount, perpPosition: PerpPosition, withFunding: boolean, oraclePriceData: Pick<OraclePriceData, 'price'>): BN;
22
+ export declare function calculatePositionPNL(market: PerpMarketAccount, perpPosition: PerpPosition, withFunding: boolean | undefined, oraclePriceData: Pick<OraclePriceData, 'price'>): BN;
24
23
  export declare function calculateClaimablePnl(market: PerpMarketAccount, spotMarket: SpotMarketAccount, perpPosition: PerpPosition, oraclePriceData: Pick<OraclePriceData, 'price'>): BN;
25
24
  /**
26
25
  * Returns total fees and funding pnl for a position
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { BN } from '../isomorphic/anchor';
3
2
  import { AMM } from '../types';
4
3
  /**
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { SpotMarketAccount, SpotBalanceType, MarginCategory } from '../types';
3
2
  import { BN } from '../isomorphic/anchor';
4
3
  import { OraclePriceData } from '../oracles/types';
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { BN } from '../isomorphic/anchor';
3
2
  import { MarginCategory, SpotBalanceType, SpotMarketAccount } from '../types';
4
3
  export declare function castNumberToSpotPrecision(value: number | BN, spotMarket: SpotMarketAccount): BN;
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { MarginCategory, SpotMarketAccount, SpotPosition } from '../types';
3
2
  import { BN } from '../isomorphic/anchor';
4
3
  import { StrictOraclePrice } from '../oracles/strictOraclePrice';
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { BN } from '../isomorphic/anchor';
3
2
  import { StateAccount } from '../types';
4
3
  export declare function calculateInitUserFee(stateAccount: StateAccount): BN;
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { AddressLookupTableAccount, PublicKey, TransactionInstruction } from '@solana/web3.js';
3
2
  import { JupiterClient, QuoteResponse } from '../jupiter/jupiterClient';
4
3
  import { VelocityClient } from '../velocityClient';
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { PerpMarketAccount, PositionDirection, UserStatsAccount } from '../types';
3
2
  import { BN } from '../isomorphic/anchor';
4
3
  import { AssetType } from './amm';
@@ -27,7 +26,7 @@ export type PriceImpactUnit = 'entryPrice' | 'maxPrice' | 'priceDelta' | 'priceD
27
26
  *
28
27
  * 'newPrice' => the price of the asset after the trade : Precision PRICE_PRECISION
29
28
  */
30
- export declare function calculateTradeSlippage(direction: PositionDirection, amount: BN, market: PerpMarketAccount, inputAssetType: AssetType, mmOraclePriceData: MMOraclePriceData, useSpread?: boolean, latestSlot?: BN): [BN, BN, BN, BN];
29
+ export declare function calculateTradeSlippage(direction: PositionDirection, amount: BN, market: PerpMarketAccount, inputAssetType: AssetType | undefined, mmOraclePriceData: MMOraclePriceData, useSpread?: boolean, latestSlot?: BN): [BN, BN, BN, BN];
31
30
  /**
32
31
  * Calculates acquired amounts for trade executed
33
32
  * @param direction
@@ -39,7 +38,7 @@ export declare function calculateTradeSlippage(direction: PositionDirection, amo
39
38
  * | 'acquiredBase' => positive/negative change in user's base : BN AMM_RESERVE_PRECISION
40
39
  * | 'acquiredQuote' => positive/negative change in user's quote : BN TODO-PRECISION
41
40
  */
42
- export declare function calculateTradeAcquiredAmounts(direction: PositionDirection, amount: BN, market: PerpMarketAccount, inputAssetType: AssetType, mmOraclePriceData: MMOraclePriceData, useSpread?: boolean, latestSlot?: BN): [BN, BN, BN];
41
+ export declare function calculateTradeAcquiredAmounts(direction: PositionDirection, amount: BN, market: PerpMarketAccount, inputAssetType: AssetType | undefined, mmOraclePriceData: MMOraclePriceData, useSpread?: boolean, latestSlot?: BN): [BN, BN, BN];
43
42
  /**
44
43
  * calculateTargetPriceTrade
45
44
  * simple function for finding arbitraging trades
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { BN } from '../isomorphic/anchor';
3
2
  export declare function clampBN(x: BN, min: BN, max: BN): BN;
4
3
  export declare const squareRootBN: (n: BN) => BN;
@@ -5,5 +5,5 @@ import { VelocityProgram } from '../config';
5
5
  export declare class OracleClientCache {
6
6
  cache: Map<string, OracleClient>;
7
7
  constructor();
8
- get(oracleSource: OracleSource, connection: Connection, program: VelocityProgram): OracleClient;
8
+ get(oracleSource: OracleSource, connection: Connection, program: VelocityProgram): OracleClient | undefined;
9
9
  }
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  /// <reference types="node" />
3
2
  /// <reference types="node" />
4
3
  import { Connection, PublicKey } from '@solana/web3.js';
@@ -1,6 +1,5 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
- /// <reference types="bn.js" />
4
3
  import { Connection, PublicKey } from '@solana/web3.js';
5
4
  import { OracleClient, OraclePriceData } from './types';
6
5
  import { BN } from '../isomorphic/anchor';
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { BN } from '../isomorphic/anchor';
3
2
  export declare class StrictOraclePrice {
4
3
  current: BN;
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  /// <reference types="node" />
3
2
  /// <reference types="node" />
4
3
  /**
@@ -1,6 +1,5 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
- /// <reference types="bn.js" />
4
3
  import { Connection, PublicKey } from '@solana/web3.js';
5
4
  import { BN } from '../isomorphic/anchor';
6
5
  import { OraclePriceData } from './types';
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { OptionalOrderParams, OrderParams, OrderTriggerCondition } from './types';
3
2
  import { BN } from './isomorphic/anchor';
4
3
  export declare function getLimitOrderParams(params: Omit<OptionalOrderParams, 'orderType'> & {
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { Connection, PublicKey, TransactionMessage, AddressLookupTableAccount, VersionedTransaction, TransactionInstruction } from '@solana/web3.js';
3
2
  import { BN } from '../isomorphic/anchor';
4
3
  import { JupiterClient } from '../jupiter/jupiterClient';
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { Connection, PublicKey, TransactionMessage, AddressLookupTableAccount, TransactionInstruction } from '@solana/web3.js';
3
2
  import { BN } from '../isomorphic/anchor';
4
3
  export declare enum SwapMode {
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import * as anchor from './isomorphic/anchor29';
3
2
  import { AnchorProvider, Program } from './isomorphic/anchor29';
4
3
  import { Account } from '@solana/spl-token';
@@ -73,7 +73,7 @@ export declare class TxHandler {
73
73
  getLatestBlockhashForTransaction(): Promise<Readonly<{
74
74
  blockhash: string;
75
75
  lastValidBlockHeight: number;
76
- }>>;
76
+ }> | undefined>;
77
77
  /**
78
78
  * Resolves a usable recent blockhash, preferring a caller-provided one and
79
79
  * otherwise fetching the latest. Throws if no blockhash can be obtained,
@@ -115,7 +115,7 @@ export declare class TxHandler {
115
115
  */
116
116
  buildBulkTransactions(props: Omit<TxBuildingProps, 'instructions'> & {
117
117
  instructions: (TransactionInstruction | TransactionInstruction[])[];
118
- }): Promise<(Transaction | VersionedTransaction)[]>;
118
+ }): Promise<(Transaction | VersionedTransaction | undefined)[]>;
119
119
  /**
120
120
  *
121
121
  * @param instructions
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  /// <reference types="node" />
3
2
  /// <reference types="node" />
4
3
  /**
@@ -428,8 +427,8 @@ export declare class SettlePnlMode {
428
427
  mustSettle: {};
429
428
  };
430
429
  }
431
- export declare function isVariant(object: unknown, type: string): any;
432
- export declare function isOneOfVariant(object: unknown, types: string[]): any;
430
+ export declare function isVariant(object: unknown, type: string): boolean;
431
+ export declare function isOneOfVariant(object: unknown, types: string[]): boolean;
433
432
  export declare function getVariant(object: unknown): string;
434
433
  export declare enum TradeSide {
435
434
  None = 0,