upshift-config 0.5.14

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 (316) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +349 -0
  3. package/lib/abis/AddressResolver.d.ts +28 -0
  4. package/lib/abis/AddressResolver.js +23 -0
  5. package/lib/abis/ChainlinkV3.d.ts +87 -0
  6. package/lib/abis/ChainlinkV3.js +117 -0
  7. package/lib/abis/ERC20.d.ts +168 -0
  8. package/lib/abis/ERC20.js +226 -0
  9. package/lib/abis/ERC20_Bytes32.d.ts +139 -0
  10. package/lib/abis/ERC20_Bytes32.js +196 -0
  11. package/lib/abis/ERC4626.d.ts +364 -0
  12. package/lib/abis/ERC4626.js +507 -0
  13. package/lib/abis/ERC721.d.ts +231 -0
  14. package/lib/abis/ERC721.js +321 -0
  15. package/lib/abis/FeeOracle.d.ts +120 -0
  16. package/lib/abis/FeeOracle.js +162 -0
  17. package/lib/abis/LendingPool.d.ts +1393 -0
  18. package/lib/abis/LendingPool.js +1807 -0
  19. package/lib/abis/LendingPoolV2.d.ts +1413 -0
  20. package/lib/abis/LendingPoolV2.js +1833 -0
  21. package/lib/abis/LendingPoolV3.d.ts +1677 -0
  22. package/lib/abis/LendingPoolV3.js +1160 -0
  23. package/lib/abis/Loan.d.ts +837 -0
  24. package/lib/abis/Loan.js +1080 -0
  25. package/lib/abis/MultiAssetNativeDepositWrapper.d.ts +137 -0
  26. package/lib/abis/MultiAssetNativeDepositWrapper.js +125 -0
  27. package/lib/abis/Multicall3.d.ts +30 -0
  28. package/lib/abis/Multicall3.js +97 -0
  29. package/lib/abis/OFT.d.ts +116 -0
  30. package/lib/abis/OFT.js +85 -0
  31. package/lib/abis/PoolAdapter.d.ts +36 -0
  32. package/lib/abis/PoolAdapter.js +51 -0
  33. package/lib/abis/RewardDistributor.d.ts +267 -0
  34. package/lib/abis/RewardDistributor.js +352 -0
  35. package/lib/abis/RwaRedeemSubaccount.d.ts +747 -0
  36. package/lib/abis/RwaRedeemSubaccount.js +548 -0
  37. package/lib/abis/SmartAccount.d.ts +17 -0
  38. package/lib/abis/SmartAccount.js +19 -0
  39. package/lib/abis/SwapRouter.d.ts +1043 -0
  40. package/lib/abis/SwapRouter.js +740 -0
  41. package/lib/abis/TextResolver.d.ts +16 -0
  42. package/lib/abis/TextResolver.js +16 -0
  43. package/lib/abis/TokenizedVaultV2.d.ts +1364 -0
  44. package/lib/abis/TokenizedVaultV2.js +1041 -0
  45. package/lib/abis/TokenizedVaultV2DepositWithPermit.d.ts +1456 -0
  46. package/lib/abis/TokenizedVaultV2DepositWithPermit.js +1878 -0
  47. package/lib/abis/TokenizedVaultV2Receipt.d.ts +1568 -0
  48. package/lib/abis/TokenizedVaultV2Receipt.js +1061 -0
  49. package/lib/abis/TokenizedVaultV2SenderAllocationWhitelist.d.ts +454 -0
  50. package/lib/abis/TokenizedVaultV2SenderAllocationWhitelist.js +327 -0
  51. package/lib/abis/TokenizedVaultV2WhitelistedAllocation.d.ts +1466 -0
  52. package/lib/abis/TokenizedVaultV2WhitelistedAllocation.js +1092 -0
  53. package/lib/abis/TokenizedVaultV2WhitelistedAssets.d.ts +274 -0
  54. package/lib/abis/TokenizedVaultV2WhitelistedAssets.js +167 -0
  55. package/lib/abis/UniversalResolverResolve.d.ts +69 -0
  56. package/lib/abis/UniversalResolverResolve.js +35 -0
  57. package/lib/abis/UniversalSignatureValidator.d.ts +17 -0
  58. package/lib/abis/UniversalSignatureValidator.js +30 -0
  59. package/lib/abis/WrapperAdapter.d.ts +71 -0
  60. package/lib/abis/WrapperAdapter.js +77 -0
  61. package/lib/abis/index.d.ts +34 -0
  62. package/lib/abis/index.js +51 -0
  63. package/lib/adapters/evm/getters.d.ts +19 -0
  64. package/lib/adapters/evm/getters.js +209 -0
  65. package/lib/adapters/evm/index.d.ts +353 -0
  66. package/lib/adapters/evm/index.js +434 -0
  67. package/lib/adapters/evm/utils.d.ts +8 -0
  68. package/lib/adapters/evm/utils.js +51 -0
  69. package/lib/adapters/solana/constants.d.ts +33 -0
  70. package/lib/adapters/solana/constants.js +52 -0
  71. package/lib/adapters/solana/getters.d.ts +11 -0
  72. package/lib/adapters/solana/getters.js +165 -0
  73. package/lib/adapters/solana/idl/vault-idl.d.ts +272 -0
  74. package/lib/adapters/solana/idl/vault-idl.js +1084 -0
  75. package/lib/adapters/solana/index.d.ts +233 -0
  76. package/lib/adapters/solana/index.js +291 -0
  77. package/lib/adapters/solana/types.d.ts +67 -0
  78. package/lib/adapters/solana/types.js +3 -0
  79. package/lib/adapters/solana/utils.d.ts +141 -0
  80. package/lib/adapters/solana/utils.js +595 -0
  81. package/lib/adapters/solana/vault.actions.d.ts +57 -0
  82. package/lib/adapters/solana/vault.actions.js +379 -0
  83. package/lib/adapters/stellar/actions.d.ts +28 -0
  84. package/lib/adapters/stellar/actions.js +77 -0
  85. package/lib/adapters/stellar/constants.d.ts +43 -0
  86. package/lib/adapters/stellar/constants.js +53 -0
  87. package/lib/adapters/stellar/getters.d.ts +68 -0
  88. package/lib/adapters/stellar/getters.js +290 -0
  89. package/lib/adapters/stellar/index.d.ts +114 -0
  90. package/lib/adapters/stellar/index.js +175 -0
  91. package/lib/adapters/stellar/soroban.d.ts +123 -0
  92. package/lib/adapters/stellar/soroban.js +613 -0
  93. package/lib/adapters/stellar/submit.d.ts +34 -0
  94. package/lib/adapters/stellar/submit.js +149 -0
  95. package/lib/adapters/stellar/types.d.ts +58 -0
  96. package/lib/adapters/stellar/types.js +6 -0
  97. package/lib/adapters/stellar/utils.d.ts +24 -0
  98. package/lib/adapters/stellar/utils.js +34 -0
  99. package/lib/adapters/sui/constants.d.ts +14 -0
  100. package/lib/adapters/sui/constants.js +29 -0
  101. package/lib/adapters/sui/getters.d.ts +9 -0
  102. package/lib/adapters/sui/getters.js +60 -0
  103. package/lib/adapters/sui/index.d.ts +45 -0
  104. package/lib/adapters/sui/index.js +101 -0
  105. package/lib/adapters/sui/transformer.d.ts +10 -0
  106. package/lib/adapters/sui/transformer.js +107 -0
  107. package/lib/adapters/sui/types.d.ts +66 -0
  108. package/lib/adapters/sui/types.js +3 -0
  109. package/lib/adapters/sui/utils.d.ts +10 -0
  110. package/lib/adapters/sui/utils.js +29 -0
  111. package/lib/core/analytics/chain-name.d.ts +9 -0
  112. package/lib/core/analytics/chain-name.js +34 -0
  113. package/lib/core/analytics/constants.d.ts +5 -0
  114. package/lib/core/analytics/constants.js +9 -0
  115. package/lib/core/analytics/env.d.ts +29 -0
  116. package/lib/core/analytics/env.js +59 -0
  117. package/lib/core/analytics/index.d.ts +36 -0
  118. package/lib/core/analytics/index.js +79 -0
  119. package/lib/core/analytics/instrumentation.d.ts +29 -0
  120. package/lib/core/analytics/instrumentation.js +277 -0
  121. package/lib/core/analytics/method-taxonomy.d.ts +19 -0
  122. package/lib/core/analytics/method-taxonomy.js +128 -0
  123. package/lib/core/analytics/metrics.d.ts +33 -0
  124. package/lib/core/analytics/metrics.js +116 -0
  125. package/lib/core/analytics/sanitize.d.ts +44 -0
  126. package/lib/core/analytics/sanitize.js +260 -0
  127. package/lib/core/analytics/sentry-runtime.d.ts +15 -0
  128. package/lib/core/analytics/sentry-runtime.js +97 -0
  129. package/lib/core/analytics/sentry.d.ts +67 -0
  130. package/lib/core/analytics/sentry.js +613 -0
  131. package/lib/core/analytics/types.d.ts +48 -0
  132. package/lib/core/analytics/types.js +3 -0
  133. package/lib/core/analytics/user-identity.d.ts +41 -0
  134. package/lib/core/analytics/user-identity.js +141 -0
  135. package/lib/core/analytics/version.d.ts +6 -0
  136. package/lib/core/analytics/version.js +10 -0
  137. package/lib/core/attribution.d.ts +111 -0
  138. package/lib/core/attribution.js +142 -0
  139. package/lib/core/auth/index.d.ts +1 -0
  140. package/lib/core/auth/index.js +18 -0
  141. package/lib/core/auth/verify.d.ts +2 -0
  142. package/lib/core/auth/verify.js +31 -0
  143. package/lib/core/base.class.d.ts +152 -0
  144. package/lib/core/base.class.js +172 -0
  145. package/lib/core/cache.d.ts +9 -0
  146. package/lib/core/cache.js +31 -0
  147. package/lib/core/constants/adapters.d.ts +103 -0
  148. package/lib/core/constants/adapters.js +180 -0
  149. package/lib/core/constants/core.d.ts +133 -0
  150. package/lib/core/constants/core.js +209 -0
  151. package/lib/core/constants/swap-router.d.ts +150 -0
  152. package/lib/core/constants/swap-router.js +169 -0
  153. package/lib/core/constants/vaults.d.ts +93 -0
  154. package/lib/core/constants/vaults.js +273 -0
  155. package/lib/core/constants/web3.d.ts +91 -0
  156. package/lib/core/constants/web3.js +229 -0
  157. package/lib/core/errors/index.d.ts +114 -0
  158. package/lib/core/errors/index.js +183 -0
  159. package/lib/core/fetcher.d.ts +198 -0
  160. package/lib/core/fetcher.js +903 -0
  161. package/lib/core/helpers/adapters.d.ts +13 -0
  162. package/lib/core/helpers/adapters.js +39 -0
  163. package/lib/core/helpers/chain-address.d.ts +13 -0
  164. package/lib/core/helpers/chain-address.js +47 -0
  165. package/lib/core/helpers/chain-error.d.ts +207 -0
  166. package/lib/core/helpers/chain-error.js +682 -0
  167. package/lib/core/helpers/chain-support.d.ts +80 -0
  168. package/lib/core/helpers/chain-support.js +115 -0
  169. package/lib/core/helpers/core.d.ts +68 -0
  170. package/lib/core/helpers/core.js +285 -0
  171. package/lib/core/helpers/explorer-link.d.ts +16 -0
  172. package/lib/core/helpers/explorer-link.js +26 -0
  173. package/lib/core/helpers/multicall.d.ts +68 -0
  174. package/lib/core/helpers/multicall.js +103 -0
  175. package/lib/core/helpers/revert-decode.d.ts +248 -0
  176. package/lib/core/helpers/revert-decode.js +515 -0
  177. package/lib/core/helpers/signer.d.ts +52 -0
  178. package/lib/core/helpers/signer.js +145 -0
  179. package/lib/core/helpers/swap-router.d.ts +211 -0
  180. package/lib/core/helpers/swap-router.js +480 -0
  181. package/lib/core/helpers/vault-version.d.ts +23 -0
  182. package/lib/core/helpers/vault-version.js +75 -0
  183. package/lib/core/helpers/vaults.d.ts +89 -0
  184. package/lib/core/helpers/vaults.js +235 -0
  185. package/lib/core/helpers/web3.d.ts +353 -0
  186. package/lib/core/helpers/web3.js +992 -0
  187. package/lib/core/index.d.ts +23 -0
  188. package/lib/core/index.js +40 -0
  189. package/lib/core/logger/index.d.ts +98 -0
  190. package/lib/core/logger/index.js +144 -0
  191. package/lib/core/logger/slack.d.ts +16 -0
  192. package/lib/core/logger/slack.js +57 -0
  193. package/lib/core/vault-metadata.d.ts +12 -0
  194. package/lib/core/vault-metadata.js +42 -0
  195. package/lib/core/version-check.d.ts +58 -0
  196. package/lib/core/version-check.js +182 -0
  197. package/lib/evm/index.d.ts +2 -0
  198. package/lib/evm/index.js +19 -0
  199. package/lib/evm/methods/crossChainVault.d.ts +128 -0
  200. package/lib/evm/methods/crossChainVault.js +853 -0
  201. package/lib/evm/methods/crossChainVaultRegistry.d.ts +93 -0
  202. package/lib/evm/methods/crossChainVaultRegistry.js +240 -0
  203. package/lib/evm/methods/index.d.ts +2 -0
  204. package/lib/evm/methods/index.js +19 -0
  205. package/lib/evm/types/crossChain.d.ts +363 -0
  206. package/lib/evm/types/crossChain.js +20 -0
  207. package/lib/evm/types/index.d.ts +1 -0
  208. package/lib/evm/types/index.js +18 -0
  209. package/lib/index.d.ts +30 -0
  210. package/lib/index.js +52 -0
  211. package/lib/main.d.ts +527 -0
  212. package/lib/main.js +601 -0
  213. package/lib/modules/api/fetcher.d.ts +82 -0
  214. package/lib/modules/api/fetcher.js +150 -0
  215. package/lib/modules/api/index.d.ts +1 -0
  216. package/lib/modules/api/index.js +6 -0
  217. package/lib/modules/api/main.d.ts +313 -0
  218. package/lib/modules/api/main.js +479 -0
  219. package/lib/modules/sub-accounts/fetcher.d.ts +53 -0
  220. package/lib/modules/sub-accounts/fetcher.js +120 -0
  221. package/lib/modules/sub-accounts/index.d.ts +2 -0
  222. package/lib/modules/sub-accounts/index.js +19 -0
  223. package/lib/modules/sub-accounts/main.d.ts +243 -0
  224. package/lib/modules/sub-accounts/main.js +205 -0
  225. package/lib/modules/sub-accounts/utils.d.ts +106 -0
  226. package/lib/modules/sub-accounts/utils.js +112 -0
  227. package/lib/modules/vaults/adapter.helpers.d.ts +64 -0
  228. package/lib/modules/vaults/adapter.helpers.js +184 -0
  229. package/lib/modules/vaults/fetcher.d.ts +147 -0
  230. package/lib/modules/vaults/fetcher.js +368 -0
  231. package/lib/modules/vaults/getters.d.ts +570 -0
  232. package/lib/modules/vaults/getters.js +3051 -0
  233. package/lib/modules/vaults/index.d.ts +20 -0
  234. package/lib/modules/vaults/index.js +44 -0
  235. package/lib/modules/vaults/main.d.ts +601 -0
  236. package/lib/modules/vaults/main.js +1623 -0
  237. package/lib/modules/vaults/prefetch.d.ts +65 -0
  238. package/lib/modules/vaults/prefetch.js +120 -0
  239. package/lib/modules/vaults/read.actions.d.ts +225 -0
  240. package/lib/modules/vaults/read.actions.js +596 -0
  241. package/lib/modules/vaults/types.d.ts +71 -0
  242. package/lib/modules/vaults/types.js +3 -0
  243. package/lib/modules/vaults/utils/call-data-decoder.d.ts +61 -0
  244. package/lib/modules/vaults/utils/call-data-decoder.js +194 -0
  245. package/lib/modules/vaults/utils/date-utils.d.ts +50 -0
  246. package/lib/modules/vaults/utils/date-utils.js +84 -0
  247. package/lib/modules/vaults/utils.d.ts +140 -0
  248. package/lib/modules/vaults/utils.js +799 -0
  249. package/lib/modules/vaults/write.actions.d.ts +529 -0
  250. package/lib/modules/vaults/write.actions.js +1749 -0
  251. package/lib/polyfills.d.ts +1 -0
  252. package/lib/polyfills.js +12 -0
  253. package/lib/sdk.d.ts +26721 -0
  254. package/lib/services/coingecko/fetcher.d.ts +15 -0
  255. package/lib/services/coingecko/fetcher.js +67 -0
  256. package/lib/services/coingecko/index.d.ts +2 -0
  257. package/lib/services/coingecko/index.js +19 -0
  258. package/lib/services/coingecko/utils.d.ts +1 -0
  259. package/lib/services/coingecko/utils.js +24 -0
  260. package/lib/services/debank/fetcher.d.ts +126 -0
  261. package/lib/services/debank/fetcher.js +47 -0
  262. package/lib/services/debank/index.d.ts +2 -0
  263. package/lib/services/debank/index.js +19 -0
  264. package/lib/services/debank/utils.d.ts +38 -0
  265. package/lib/services/debank/utils.js +297 -0
  266. package/lib/services/layerzero/deposits.d.ts +49 -0
  267. package/lib/services/layerzero/deposits.js +166 -0
  268. package/lib/services/layerzero/redeems.d.ts +20 -0
  269. package/lib/services/layerzero/redeems.js +92 -0
  270. package/lib/services/layerzero/utils.d.ts +9 -0
  271. package/lib/services/layerzero/utils.js +22 -0
  272. package/lib/services/octavfi/fetcher.d.ts +9 -0
  273. package/lib/services/octavfi/fetcher.js +103 -0
  274. package/lib/services/octavfi/index.d.ts +3 -0
  275. package/lib/services/octavfi/index.js +20 -0
  276. package/lib/services/octavfi/types.d.ts +34 -0
  277. package/lib/services/octavfi/types.js +3 -0
  278. package/lib/services/octavfi/utils.d.ts +16 -0
  279. package/lib/services/octavfi/utils.js +212 -0
  280. package/lib/services/subgraph/fetcher.d.ts +2 -0
  281. package/lib/services/subgraph/fetcher.js +61 -0
  282. package/lib/services/subgraph/index.d.ts +2 -0
  283. package/lib/services/subgraph/index.js +19 -0
  284. package/lib/services/subgraph/schema.d.ts +45 -0
  285. package/lib/services/subgraph/schema.js +75 -0
  286. package/lib/services/subgraph/vaults.d.ts +25 -0
  287. package/lib/services/subgraph/vaults.js +1106 -0
  288. package/lib/services/swap-quotes/index.d.ts +105 -0
  289. package/lib/services/swap-quotes/index.js +77 -0
  290. package/lib/services/swap-quotes/paraswap.d.ts +51 -0
  291. package/lib/services/swap-quotes/paraswap.js +138 -0
  292. package/lib/types/api.d.ts +280 -0
  293. package/lib/types/api.js +3 -0
  294. package/lib/types/index.d.ts +12 -0
  295. package/lib/types/index.js +28 -0
  296. package/lib/types/points.d.ts +28 -0
  297. package/lib/types/points.js +3 -0
  298. package/lib/types/pools.d.ts +144 -0
  299. package/lib/types/pools.js +3 -0
  300. package/lib/types/staking.d.ts +28 -0
  301. package/lib/types/staking.js +3 -0
  302. package/lib/types/sub-accounts.d.ts +140 -0
  303. package/lib/types/sub-accounts.js +3 -0
  304. package/lib/types/subgraph.d.ts +74 -0
  305. package/lib/types/subgraph.js +3 -0
  306. package/lib/types/typed-contract.d.ts +102 -0
  307. package/lib/types/typed-contract.js +3 -0
  308. package/lib/types/user.d.ts +1 -0
  309. package/lib/types/user.js +3 -0
  310. package/lib/types/vaults.d.ts +714 -0
  311. package/lib/types/vaults.js +24 -0
  312. package/lib/types/web3.d.ts +51 -0
  313. package/lib/types/web3.js +14 -0
  314. package/lib/types/webserver.d.ts +698 -0
  315. package/lib/types/webserver.js +3 -0
  316. package/package.json +78 -0
@@ -0,0 +1,363 @@
1
+ /**
2
+ * Cross-Chain Vault Type Definitions
3
+ *
4
+ * Defines all request/response interfaces for LayerZero OVault cross-chain
5
+ * vault operations. These types are generic and not tied to any specific
6
+ * vault configuration — SDK consumers provide their own config.
7
+ *
8
+ * @module evm/types/crossChain
9
+ */
10
+ import type { IAddress } from '../../types';
11
+ /**
12
+ * Injected dependency for the `@layerzerolabs/ovault-evm` SDK.
13
+ *
14
+ * Because the `@layerzerolabs/ovault-evm` package has broken ESM exports
15
+ * (bare directory imports in a `"type": "module"` package), the SDK cannot
16
+ * `require()` it internally. Instead, the consuming application imports it
17
+ * in its own bundler context and passes it to SDK functions via this type.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * import { OVaultSyncMessageBuilder, OVaultSyncOperations } from '@layerzerolabs/ovault-evm';
22
+ *
23
+ * await buildCrossChainVaultTx({
24
+ * ovaultSdk: { OVaultSyncMessageBuilder, OVaultSyncOperations },
25
+ * // ...other params
26
+ * });
27
+ * ```
28
+ */
29
+ export interface IOVaultSdkDependency {
30
+ OVaultSyncMessageBuilder: {
31
+ generateOVaultInputs: (input: unknown) => Promise<unknown>;
32
+ [key: string]: unknown;
33
+ };
34
+ OVaultSyncOperations: {
35
+ DEPOSIT: string;
36
+ REDEEM: string;
37
+ };
38
+ }
39
+ /**
40
+ * Cross-chain vault configuration provided by SDK consumers.
41
+ *
42
+ * Each vault deployment requires 5 contract types:
43
+ * 1. AssetOFT — OFT wrapper for the underlying asset (e.g., USDC) on hub + spoke chains
44
+ * 2. ERC4626 Vault — The actual vault contract on the hub chain
45
+ * 3. ShareOFTAdapter — Wraps vault shares for cross-chain transport (hub chain)
46
+ * 4. ComposerSync — Orchestrates cross-chain operations (hub chain)
47
+ * 5. ShareOFT — Share token representation on spoke chains
48
+ */
49
+ export interface ICrossChainVaultConfig {
50
+ /** Human-readable vault name */
51
+ vaultName: string;
52
+ /** Vault receipt token symbol */
53
+ vaultSymbol: string;
54
+ /** Chain ID where the ERC4626 vault lives */
55
+ hubChainId: number;
56
+ /** Address of the ERC4626 vault on the hub chain */
57
+ vaultAddress: IAddress;
58
+ /** Chain IDs where users can deposit from (spoke chains) */
59
+ spokeChainIds: number[];
60
+ /** Contract addresses for the OVault deployment */
61
+ contracts: {
62
+ /** Underlying asset token addresses per chain (e.g., native USDC) */
63
+ assetToken: Record<number, IAddress>;
64
+ /** AssetOFT (OFT wrapper for the asset) addresses per chain */
65
+ assetOFT: Record<number, IAddress>;
66
+ /** ShareOFTAdapter address on the hub chain */
67
+ shareOFTAdapter: IAddress;
68
+ /** VaultComposerSync address on the hub chain */
69
+ composerSync: IAddress;
70
+ /** ShareOFT addresses on spoke chains */
71
+ shareOFT: Record<number, IAddress>;
72
+ };
73
+ /** LayerZero Endpoint IDs (NOT chain IDs) */
74
+ layerZeroEids: {
75
+ /** Hub chain LayerZero EID */
76
+ hub: number;
77
+ /** Spoke chain LayerZero EIDs keyed by chain ID */
78
+ spokes: Record<number, number>;
79
+ };
80
+ /**
81
+ * Multi-asset vault support.
82
+ * When set, the vault uses `previewDeposit(address, uint256)` instead of
83
+ * the standard ERC4626 `previewDeposit(uint256)`.
84
+ */
85
+ multiAsset?: {
86
+ /** Asset address on hub chain used for previewDeposit calls */
87
+ hubAssetAddress: IAddress;
88
+ };
89
+ /**
90
+ * When `true`, the vault's receipt token cannot leave the hub chain: there
91
+ * is no OFT/bridge for it, so minting shares on a spoke would strand the
92
+ * user (AUGUST-6300). Withdraw UIs must offer the hub chain only. Defaults
93
+ * to `false` when omitted. Drives `getWithdrawDestinationChains`.
94
+ */
95
+ hubOnlyReceipt?: boolean;
96
+ }
97
+ /** Operation type for cross-chain vault transactions */
98
+ export type CrossChainOperation = 'DEPOSIT' | 'REDEEM';
99
+ /**
100
+ * Parameters for building a cross-chain vault transaction.
101
+ * Used internally by `buildCrossChainVaultTx`.
102
+ */
103
+ export interface ICrossChainBuildRequest {
104
+ /** Injected `@layerzerolabs/ovault-evm` SDK dependency */
105
+ ovaultSdk: IOVaultSdkDependency;
106
+ /** Cross-chain vault configuration */
107
+ config: ICrossChainVaultConfig;
108
+ /** Operation to perform */
109
+ operation: CrossChainOperation;
110
+ /** Amount to deposit/redeem (human-readable string, raw bigint, or number) */
111
+ amount: string | number | bigint;
112
+ /** Decimals of the token being deposited/redeemed */
113
+ decimals: number;
114
+ /** Chain ID the user is currently on */
115
+ userChainId: number;
116
+ /** User's wallet address */
117
+ walletAddress: IAddress;
118
+ /** Chain to receive shares (deposit) or assets (redeem). Defaults to user's chain */
119
+ destinationChainId?: number;
120
+ /** Recipient address. Defaults to walletAddress */
121
+ recipientAddress?: IAddress;
122
+ /** Slippage tolerance in basis points (default: 100 = 1%) */
123
+ slippageBps?: number;
124
+ /**
125
+ * viem Chain object for the hub chain (with RPC URLs configured).
126
+ * Required for SDK to create a public client for on-chain reads.
127
+ */
128
+ hubChain: unknown;
129
+ /**
130
+ * viem Chain object for the user's source chain (with RPC URLs configured).
131
+ */
132
+ sourceChain: unknown;
133
+ /** Fee buffer percentage applied to LZ native fees (default: 50) */
134
+ feeBufferPercent?: number;
135
+ /** Gas limit for lzCompose on hub chain (default: 2_000_000n) */
136
+ hubLzComposeGasLimit?: bigint;
137
+ }
138
+ /**
139
+ * Result from building a cross-chain vault transaction.
140
+ */
141
+ export interface ICrossChainBuildResult {
142
+ success: boolean;
143
+ data?: {
144
+ /** Contract address to call */
145
+ contractAddress: IAddress;
146
+ /** Function name to call on the contract */
147
+ contractFunctionName: string;
148
+ /** ABI for the contract call */
149
+ abi: readonly unknown[];
150
+ /** Arguments for the contract function */
151
+ txArgs: readonly unknown[];
152
+ /** Native value to send with the transaction (includes LZ fees) */
153
+ messageValue: bigint;
154
+ /** LayerZero messaging fee breakdown */
155
+ messageFee: {
156
+ nativeFee: bigint;
157
+ lzTokenFee: bigint;
158
+ };
159
+ /** Expected output amount on destination */
160
+ dstAmount: bigint;
161
+ /** Minimum output amount (after slippage) */
162
+ minDstAmount: bigint;
163
+ /** Approval info if token approval is required */
164
+ approval?: {
165
+ tokenAddress: IAddress;
166
+ spender: IAddress;
167
+ amount: bigint;
168
+ };
169
+ };
170
+ error?: string;
171
+ }
172
+ /**
173
+ * Request parameters for executing a cross-chain deposit.
174
+ */
175
+ export interface ICrossChainDepositRequest {
176
+ /** Injected `@layerzerolabs/ovault-evm` SDK dependency */
177
+ ovaultSdk: IOVaultSdkDependency;
178
+ /** Cross-chain vault configuration */
179
+ config: ICrossChainVaultConfig;
180
+ /** Amount to deposit (human-readable) */
181
+ amount: string;
182
+ /** Decimals of the deposit token */
183
+ decimals: number;
184
+ /** Chain ID the user is depositing from */
185
+ userChainId: number;
186
+ /** User's wallet address */
187
+ walletAddress: IAddress;
188
+ /** viem WalletClient for signing transactions */
189
+ walletClient: unknown;
190
+ /** viem PublicClient for reading chain state */
191
+ publicClient: unknown;
192
+ /** viem Chain object for the hub chain (with RPC URLs) */
193
+ hubChain: unknown;
194
+ /** viem Chain object for the source chain (with RPC URLs) */
195
+ sourceChain: unknown;
196
+ /** Chain to receive shares on. Defaults to user's chain */
197
+ destinationChainId?: number;
198
+ /** Skip the internal approval check (set true when caller handles approval) */
199
+ skipApprovalCheck?: boolean;
200
+ /** Slippage tolerance in basis points (default: 100 = 1%) */
201
+ slippageBps?: number;
202
+ /** Fee buffer percentage (default: 50) */
203
+ feeBufferPercent?: number;
204
+ /** Gas buffer multiplier as percentage (default: 150 = 1.5x) */
205
+ gasBufferPercent?: number;
206
+ }
207
+ /**
208
+ * Result from a cross-chain deposit execution.
209
+ */
210
+ export interface ICrossChainDepositResult {
211
+ /** Transaction hash */
212
+ transactionHash: string;
213
+ /** Whether the on-chain receipt shows success */
214
+ success: boolean;
215
+ }
216
+ /**
217
+ * Request parameters for executing a cross-chain redemption.
218
+ */
219
+ export interface ICrossChainRedeemRequest {
220
+ /** Injected `@layerzerolabs/ovault-evm` SDK dependency */
221
+ ovaultSdk: IOVaultSdkDependency;
222
+ /** Cross-chain vault configuration */
223
+ config: ICrossChainVaultConfig;
224
+ /** Amount of shares to redeem (human-readable) */
225
+ amount: string;
226
+ /** Decimals of the share token */
227
+ decimals: number;
228
+ /** Chain ID the user is on (must be hub chain) */
229
+ userChainId: number;
230
+ /** User's wallet address */
231
+ walletAddress: IAddress;
232
+ /** viem WalletClient for signing transactions */
233
+ walletClient: unknown;
234
+ /** viem PublicClient for reading chain state */
235
+ publicClient: unknown;
236
+ /** viem Chain object for the hub chain (with RPC URLs) */
237
+ hubChain: unknown;
238
+ /** viem Chain object for the source chain (with RPC URLs) */
239
+ sourceChain: unknown;
240
+ /** Chain to receive assets on. Defaults to user's chain */
241
+ destinationChainId?: number;
242
+ /** Skip the internal approval check (set true when caller handles approval) */
243
+ skipApprovalCheck?: boolean;
244
+ /** Slippage tolerance in basis points (default: 100 = 1%) */
245
+ slippageBps?: number;
246
+ /** Fee buffer percentage (default: 50) */
247
+ feeBufferPercent?: number;
248
+ /** Gas buffer multiplier as percentage (default: 200 = 2x) */
249
+ gasBufferPercent?: number;
250
+ /** Minimum gas limit for redeem operations (default: 5_000_000n) */
251
+ minGasLimit?: bigint;
252
+ }
253
+ /**
254
+ * Result from a cross-chain redeem execution.
255
+ */
256
+ export interface ICrossChainRedeemResult {
257
+ /** Transaction hash */
258
+ transactionHash: string;
259
+ /** Whether the on-chain receipt shows success */
260
+ success: boolean;
261
+ }
262
+ /**
263
+ * Request parameters for quoting a cross-chain deposit.
264
+ */
265
+ export interface IQuoteCrossChainDepositRequest {
266
+ /** Injected `@layerzerolabs/ovault-evm` SDK dependency */
267
+ ovaultSdk: IOVaultSdkDependency;
268
+ /** Cross-chain vault configuration */
269
+ config: ICrossChainVaultConfig;
270
+ /** Amount to deposit (human-readable) */
271
+ amount: string;
272
+ /** Decimals of the deposit token */
273
+ decimals: number;
274
+ /** Chain ID the user would deposit from */
275
+ userChainId: number;
276
+ /** User's wallet address */
277
+ walletAddress: IAddress;
278
+ /** viem Chain object for the hub chain (with RPC URLs) */
279
+ hubChain: unknown;
280
+ /** viem Chain object for the source chain (with RPC URLs) */
281
+ sourceChain: unknown;
282
+ /** Destination chain for shares */
283
+ destinationChainId?: number;
284
+ /** Slippage tolerance in basis points (default: 100 = 1%) */
285
+ slippageBps?: number;
286
+ /** Fee buffer percentage (default: 50) */
287
+ feeBufferPercent?: number;
288
+ }
289
+ /**
290
+ * Request parameters for quoting a cross-chain redeem.
291
+ */
292
+ export interface IQuoteCrossChainRedeemRequest {
293
+ /** Injected `@layerzerolabs/ovault-evm` SDK dependency */
294
+ ovaultSdk: IOVaultSdkDependency;
295
+ /** Cross-chain vault configuration */
296
+ config: ICrossChainVaultConfig;
297
+ /** Amount of shares to redeem (human-readable) */
298
+ amount: string;
299
+ /** Decimals of the share token */
300
+ decimals: number;
301
+ /** User's wallet address */
302
+ walletAddress: IAddress;
303
+ /** viem Chain object for the hub chain (with RPC URLs) */
304
+ hubChain: unknown;
305
+ /** viem Chain object for the source chain (with RPC URLs) */
306
+ sourceChain: unknown;
307
+ /** Destination chain for assets */
308
+ destinationChainId?: number;
309
+ /** Slippage tolerance in basis points (default: 100 = 1%) */
310
+ slippageBps?: number;
311
+ /** Fee buffer percentage (default: 50) */
312
+ feeBufferPercent?: number;
313
+ }
314
+ /**
315
+ * Result from a cross-chain fee/output quote.
316
+ */
317
+ export interface IQuoteCrossChainResult {
318
+ /** Native fee in wei (includes buffer) */
319
+ nativeFee: bigint;
320
+ /** Expected output amount on destination */
321
+ dstAmount: bigint;
322
+ /** Minimum output amount (after slippage) */
323
+ minDstAmount: bigint;
324
+ /** Unix epoch (ms) when this quote was generated. */
325
+ quotedAt: number;
326
+ /** Unix epoch (ms) after which this quote is stale. */
327
+ expiresAt: number;
328
+ }
329
+ /** Default validity window for a cross-chain quote (30s). */
330
+ export declare const CROSS_CHAIN_QUOTE_TTL_MS = 30000;
331
+ /** Returns `true` when the quote should be refreshed before submitting. */
332
+ export declare function isQuoteStale(quote: Pick<IQuoteCrossChainResult, 'expiresAt'>, now?: number): boolean;
333
+ /**
334
+ * Cross-chain operation status for tracking LayerZero messages.
335
+ */
336
+ export interface ICrossChainOperationStatus {
337
+ /** Source chain transaction hash */
338
+ srcTxHash: string;
339
+ /** Current status of the cross-chain message */
340
+ status: 'PENDING' | 'INFLIGHT' | 'DELIVERED' | 'FAILED';
341
+ /** Source chain ID */
342
+ srcChainId: number;
343
+ /** Destination chain ID */
344
+ dstChainId: number;
345
+ }
346
+ /**
347
+ * Refund status for failed cross-chain operations.
348
+ * LayerZero may refund assets if delivery fails.
349
+ */
350
+ export interface IRefundStatus {
351
+ /** Whether a refund has been initiated */
352
+ refunded: boolean;
353
+ /** Refund transaction hash (if available) */
354
+ refundTxHash?: string;
355
+ /** Amount refunded in the source token's smallest unit */
356
+ refundAmount?: bigint;
357
+ /** Chain ID where the refund was issued */
358
+ refundChainId?: number;
359
+ }
360
+ /**
361
+ * Error classification for cross-chain operations.
362
+ */
363
+ export type CrossChainErrorType = 'max-deposit' | 'nonce' | 'no-peer' | 'bridge-fee' | 'insufficient-balance' | 'user-rejected' | 'gas' | 'network' | 'unknown';
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ /**
3
+ * Cross-Chain Vault Type Definitions
4
+ *
5
+ * Defines all request/response interfaces for LayerZero OVault cross-chain
6
+ * vault operations. These types are generic and not tied to any specific
7
+ * vault configuration — SDK consumers provide their own config.
8
+ *
9
+ * @module evm/types/crossChain
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CROSS_CHAIN_QUOTE_TTL_MS = void 0;
13
+ exports.isQuoteStale = isQuoteStale;
14
+ /** Default validity window for a cross-chain quote (30s). */
15
+ exports.CROSS_CHAIN_QUOTE_TTL_MS = 30_000;
16
+ /** Returns `true` when the quote should be refreshed before submitting. */
17
+ function isQuoteStale(quote, now = Date.now()) {
18
+ return now >= quote.expiresAt;
19
+ }
20
+ //# sourceMappingURL=crossChain.js.map
@@ -0,0 +1 @@
1
+ export * from './crossChain';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./crossChain"), exports);
18
+ //# sourceMappingURL=index.js.map
package/lib/index.d.ts ADDED
@@ -0,0 +1,30 @@
1
+ import './polyfills';
2
+ /**
3
+ * Export other packages
4
+ */
5
+ export * from './types';
6
+ export * from './core';
7
+ export * from './abis';
8
+ export * from './services/debank';
9
+ export * from './services/swap-quotes';
10
+ export * from './modules/vaults';
11
+ export * from './modules/sub-accounts';
12
+ export * from './modules/api';
13
+ /**
14
+ * EVM cross-chain (LayerZero OVault) exports
15
+ */
16
+ export * from './evm';
17
+ /**
18
+ * Solana export
19
+ */
20
+ export * from './adapters/solana';
21
+ /**
22
+ * Stellar export
23
+ */
24
+ export * from './adapters/stellar';
25
+ export declare const VAULT_ADDRESSES: Record<"musd" | "predlp" | "sentusd" | "pregrid" | "repouscc" | "earnxrp" | "tivkbtc" | "tivusdt0" | "supermon" | "earnmon" | "k3europ" | "wmon/ausd" | "wbtc/ausd" | "earnausd_monad" | "sausd" | "farmbold" | "sentuscc" | "sentbtc" | "svusdc" | "apusdc" | "testwethtsa" | "tacusr" | "upinjusdt" | "tac-teth" | "upausd" | "taccbbtc" | "xupusdc" | "uptbtc" | "gteth" | "ageth" | "upusdc" | "hgeth" | "upssylva" | "hbbtc" | "hbhype" | "upazt" | "susdt" | "upedge" | "coreusdc" | "upcusdo" | "shifteth" | "upsusde" | "uplbtc" | "upavax" | "tacrseth" | "earnausd" | "alpineusdcflagship" | "alpinecoinshiftusdc" | "upbtc" | "upstrbtc" | "maxiusr" | "upgammausdc" | "xhype" | "wildusd" | "alpinebtc" | "prenusd" | "upyzusd" | "upnusd" | "hlpe" | "nemo eth yield", `0x${string}`>;
26
+ /**
27
+ * Export the SDK class as default
28
+ */
29
+ import { AugustSDK } from './main';
30
+ export default AugustSDK;
package/lib/index.js ADDED
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.VAULT_ADDRESSES = void 0;
18
+ require("./polyfills");
19
+ /**
20
+ * Export other packages
21
+ */
22
+ __exportStar(require("./types"), exports);
23
+ __exportStar(require("./core"), exports);
24
+ __exportStar(require("./abis"), exports);
25
+ __exportStar(require("./services/debank"), exports);
26
+ __exportStar(require("./services/swap-quotes"), exports);
27
+ __exportStar(require("./modules/vaults"), exports);
28
+ __exportStar(require("./modules/sub-accounts"), exports);
29
+ __exportStar(require("./modules/api"), exports);
30
+ /**
31
+ * EVM cross-chain (LayerZero OVault) exports
32
+ */
33
+ __exportStar(require("./evm"), exports);
34
+ /**
35
+ * Solana export
36
+ */
37
+ __exportStar(require("./adapters/solana"), exports);
38
+ /**
39
+ * Stellar export
40
+ */
41
+ __exportStar(require("./adapters/stellar"), exports);
42
+ /**
43
+ * Upshift Vaults
44
+ */
45
+ const vaults_1 = require("./core/constants/vaults");
46
+ exports.VAULT_ADDRESSES = vaults_1.VAULT_SYMBOLS_REVERSE;
47
+ /**
48
+ * Export the SDK class as default
49
+ */
50
+ const main_1 = require("./main");
51
+ exports.default = main_1.AugustSDK;
52
+ //# sourceMappingURL=index.js.map