upshift-sdk 8.20.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.
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
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 August Digital
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,349 @@
1
+ # August Digital SDK
2
+
3
+ TypeScript SDK for interacting with August Digital vaults across EVM, Solana, Stellar, and Sui chains.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @augustdigital/sdk ethers
9
+ # or
10
+ pnpm add @augustdigital/sdk ethers
11
+ # or
12
+ yarn add @augustdigital/sdk ethers
13
+ ```
14
+
15
+ ### Wagmi/Viem Support
16
+
17
+ The SDK supports both ethers and wagmi/viem signers. If you're using wagmi in your React app, also install viem:
18
+
19
+ ```bash
20
+ npm install viem
21
+ ```
22
+
23
+ The SDK automatically converts viem `WalletClient` to an ethers-compatible signer.
24
+
25
+ ## Quick Start
26
+
27
+ ```typescript
28
+ import AugustSDK from '@augustdigital/sdk';
29
+
30
+ const sdk = new AugustSDK({
31
+ // Required: stable kebab-case slug identifying your application.
32
+ appName: 'acme-trader',
33
+ providers: {
34
+ 1: 'https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY',
35
+ 42161: 'https://arb-mainnet.g.alchemy.com/v2/YOUR_KEY',
36
+ -1: 'https://api.mainnet-beta.solana.com', // Solana
37
+ },
38
+ keys: {
39
+ august: 'YOUR_API_KEY', // Optional: required for allocations, health factors, and sub-account operations
40
+ },
41
+ monitoring: {
42
+ env: 'DEV', // Optional: 'DEV' enables console logging (defaults to 'PROD')
43
+ },
44
+ });
45
+
46
+ // Fetch all vaults
47
+ const vaults = await sdk.getVaults();
48
+
49
+ // Fetch a specific vault with loans and allocations
50
+ const vault = await sdk.getVault({
51
+ vault: '0x...',
52
+ options: { loans: true, allocations: true },
53
+ });
54
+
55
+ // Get user positions
56
+ const positions = await sdk.getVaultPositions({
57
+ wallet: '0x...',
58
+ showAllVaults: true,
59
+ });
60
+ ```
61
+
62
+ ### App Name
63
+
64
+ `appName` is required on every `AugustSDK` constructor call. Pass a stable kebab-case slug
65
+ identifying your application (e.g. `'acme-trader'`, `'my-defi-app'`):
66
+
67
+ - **What it's used for.** August Digital tags analytics events with `app.name = <yourSlug>` to
68
+ attribute error spikes and prioritize bug fixes by consuming app.
69
+ - **What it is not.** Not a secret, not a license key, not a display label. Pick a slug once
70
+ and reuse it across deployments.
71
+ - **Constraints.** 3–64 characters, only `[a-zA-Z0-9._-]`. The SDK throws synchronously from
72
+ the constructor if the value is missing or invalid.
73
+
74
+ ```typescript
75
+ // Will throw — appName is required.
76
+ new AugustSDK({ providers: { /* ... */ } } as any);
77
+
78
+ // Will throw — spaces not allowed. Use 'acme-trader'.
79
+ new AugustSDK({ appName: 'Acme Trader', providers: { /* ... */ } });
80
+
81
+ // Correct.
82
+ new AugustSDK({ appName: 'acme-trader', providers: { /* ... */ } });
83
+ ```
84
+
85
+ ## Architecture
86
+
87
+ ```
88
+ src.ts/
89
+ ├── main.ts # Main SDK class (AugustSDK)
90
+ ├── core/ # Base utilities
91
+ │ ├── base.class.ts # Base SDK functionality
92
+ │ ├── fetcher.ts # API client with retry logic
93
+ │ └── web3.helpers.ts # Blockchain utilities
94
+ ├── adapters/ # Chain-specific implementations
95
+ │ ├── evm/ # EVM adapter (approve, deposit, redeem, read helpers)
96
+ │ ├── solana/ # Solana program adapters
97
+ │ ├── stellar/ # Stellar vault adapters
98
+ │ └── sui/ # Sui (Ember) vault adapters
99
+ ├── evm/ # EVM cross-chain (LayerZero OVault)
100
+ ├── modules/ # Feature modules
101
+ │ ├── vaults/ # Vault read operations
102
+ │ ├── sub-accounts/ # Sub-account queries
103
+ │ └── api/ # August backend API integration
104
+ ├── services/ # External service integrations
105
+ │ ├── debank/ # DeFi allocation data
106
+ │ ├── coingecko/ # Token pricing
107
+ │ └── subgraph/ # Historical transaction data
108
+ └── types/ # TypeScript interfaces
109
+ ```
110
+
111
+ ## Key Concepts
112
+
113
+ ### Multi-Chain Support
114
+
115
+ - **EVM Chains**: Ethereum, Arbitrum, Base, BSC, Avalanche, and more — `wagmi/viem` and `ethers` signers supported
116
+ - **Solana**: Native Solana program support with full vault functionality
117
+ - **Stellar**: Stellar vault deposit, redeem, and position queries
118
+ - **Sui**: Ember vault read operations
119
+ - Unified interface across all chains
120
+
121
+ ### Vault Versions
122
+
123
+ - `evm-0/evm-1`: Legacy vault contracts
124
+ - `evm-2`: Current EVM vault architecture (separate receipt tokens)
125
+ - `sol-0`: Solana program-based vaults
126
+ - `stellar-0`: Stellar-based vaults
127
+
128
+ ### Data Enrichment
129
+
130
+ All vault queries support optional enrichment:
131
+
132
+ - `loans`: Include active loan data
133
+ - `allocations`: DeFi/CeFi/OTC position breakdowns
134
+ - `wallet`: User-specific position data
135
+
136
+ ## API Reference
137
+
138
+ ### Vault Queries
139
+
140
+ | Method | Description |
141
+ | --- | --- |
142
+ | `getVaults(options?)` | Fetch all vaults across chains |
143
+ | `getVault({ vault, chainId?, options? })` | Get single vault details |
144
+ | `getVaultLoans({ vault, chainId? })` | Fetch active loans |
145
+ | `getVaultAllocations({ vault, chainId? })` | Get allocation breakdown |
146
+ | `getVaultHistoricalTimeseries({ vault, chainId? })` | Historical APY and TVL timeseries |
147
+ | `getVaultApy({ vault, historical? })` | **@deprecated** — use `getVaultHistoricalTimeseries` |
148
+ | `getVaultTvl({ vault, historical? })` | Current/historical TVL |
149
+ | `getVaultAnnualizedApy({ vault })` | Annualized APY for a vault |
150
+ | `getVaultSummary({ vault })` | Aggregated vault summary |
151
+ | `getVaultPnl({ vault, chainId? })` | Vault-level PnL |
152
+ | `getVaultUnrealizedPnlHistory({ vault, chainId?, ... })` | Unrealized PnL timeseries |
153
+ | `getLatestUnrealizedPnl()` | Latest unrealized PnL snapshot across all vaults |
154
+ | `getYieldLastRealizedOn({ vault, chainId? })` | Timestamp of last yield realization |
155
+ | `getTotalDeposited(options?)` | Total deposited across vaults |
156
+
157
+ ### User Positions
158
+
159
+ | Method | Description |
160
+ | --- | --- |
161
+ | `getVaultPositions({ wallet?, vault?, chainId? })` | User vault positions |
162
+ | `getVaultAvailableRedemptions({ vault, wallet?, chainId, verbose? })` | Claimable redemptions |
163
+ | `getVaultRedemptionHistory({ vault, wallet?, chainId? })` | Historical redemptions |
164
+ | `getVaultUserHistory({ wallet, vault?, chainId? })` | Transaction history |
165
+ | `getVaultUserTransfers({ wallet, vault?, chainId? })` | Transfer history |
166
+ | `getVaultUserLifetimePnl({ wallet, vault?, chainId? })` | Lifetime PnL for a wallet |
167
+ | `getVaultStakingPositions({ wallet, chainId })` | Staking positions |
168
+ | `getVaultBorrowerHealthFactor(props?)` | Borrower health factor |
169
+ | `getVaultWithdrawals({ vault, chainId? })` | Pending withdrawals |
170
+
171
+ ### Points
172
+
173
+ | Method | Description |
174
+ | --- | --- |
175
+ | `getUserPoints(userAddress)` | Points balance for a wallet |
176
+ | `registerUserForPoints({ wallet, referral? })` | Register a wallet for the points program |
177
+ | `fetchPointsLeaderboard(params?)` | Points leaderboard |
178
+
179
+ ### Write Operations (top-level)
180
+
181
+ | Method | Description |
182
+ | --- | --- |
183
+ | `vaultDeposit(signer, options)` | Deposit into a vault |
184
+ | `previewRedemption(props)` | Preview redemption output before broadcasting |
185
+
186
+ ### Cross-Chain (LayerZero)
187
+
188
+ | Method | Description |
189
+ | --- | --- |
190
+ | `getLayerZeroDeposits({ wallet?, chainId? })` | LayerZero deposit history |
191
+ | `getLayerZeroRedeems(props?)` | LayerZero redemption history |
192
+
193
+ ### Utilities
194
+
195
+ | Method | Description |
196
+ | --- | --- |
197
+ | `getPrice(symbol)` | Token price in USD |
198
+ | `switchNetwork(chainId)` | Change active chain |
199
+ | `updateWallet(address)` | Set active wallet for tracking |
200
+
201
+ ### Sub-Accounts (`sdk.subAccountsModule`)
202
+
203
+ | Method | Description |
204
+ | --- | --- |
205
+ | `getSubaccountHealthFactor(address)` | Health factor for a sub-account |
206
+ | `getSubaccountLoans(address)` | Active loans for a sub-account |
207
+ | `getSubaccountCefiPositions(address)` | CeFi positions |
208
+ | `getSubaccountOtcPositions(address)` | OTC positions |
209
+ | `getSubaccountSummary(address)` | Aggregated sub-account summary |
210
+
211
+ ### EVM Adapter (`sdk.evm`)
212
+
213
+ Set a signer before calling write methods:
214
+
215
+ ```typescript
216
+ // ethers
217
+ import { JsonRpcProvider, Wallet } from 'ethers';
218
+ const wallet = new Wallet(process.env.PRIVATE_KEY!, new JsonRpcProvider(rpcUrl));
219
+ sdk.evm.setSigner(wallet);
220
+
221
+ // wagmi/viem (browser)
222
+ import { useWalletClient } from 'wagmi';
223
+ const { data: walletClient } = useWalletClient();
224
+ if (walletClient) sdk.evm.setSigner(walletClient);
225
+ ```
226
+
227
+ **Write methods:**
228
+
229
+ | Method | Description |
230
+ | --- | --- |
231
+ | `vaultApprove(options)` | Approve token spend for a vault |
232
+ | `approve(options)` | Generic ERC-20 approve |
233
+ | `vaultDeposit(options)` | Deposit assets into a vault |
234
+ | `vaultRequestRedeem(options)` | Request a withdrawal/redemption |
235
+ | `vaultRedeem(signer, options)` | Claim an available redemption |
236
+ | `depositNative(options)` | Deposit native tokens (ETH, etc.) |
237
+ | `swapAndDeposit(options)` | Swap and deposit in one call |
238
+ | `depositViaSwapRouter(options)` | Deposit via the swap router |
239
+ | `depositNativeViaSwapRouter(options)` | Deposit native via the swap router |
240
+
241
+ **Read helpers (return raw `bigint`):**
242
+
243
+ | Method | Description |
244
+ | --- | --- |
245
+ | `previewDeposit(options)` | Shares minted for a deposit amount |
246
+ | `previewRedeem(options)` | Assets returned for a share amount |
247
+ | `allowance(options)` | ERC-20 allowance granted to the vault |
248
+ | `balanceOf(options)` | ERC-20 balance for any token/owner |
249
+ | `maxDeposit(options)` | Maximum deposit accepted by the vault |
250
+ | `vaultAllowance(options)` | Vault-specific allowance check |
251
+ | `getDeposited(options)` | Current deposited balance |
252
+ | `getRemainingAllocations(options)` | Remaining allocation capacity |
253
+ | `isWhitelisted(options)` | Check whitelist status |
254
+
255
+ ### Solana Adapter (`sdk.solana`)
256
+
257
+ | Method | Description |
258
+ | --- | --- |
259
+ | `getVaultState(...)` | Vault state from the Solana program |
260
+ | `getVaultStateReadOnly(...)` | Read-only vault state |
261
+ | `getToken(mintAddress)` | SPL token info |
262
+ | `getTokenSymbol(mintAddress)` | Token symbol |
263
+ | `fetchUserTokenBalance(publicKey, mint)` | User SPL token balance |
264
+ | `fetchUserShareBalance(publicKey, vault)` | User share balance |
265
+ | `fetchUserShareBalanceRaw(publicKey, vault)` | Raw share balance (bigint) |
266
+
267
+ ### Stellar Adapter (`sdk.stellar`)
268
+
269
+ | Method | Description |
270
+ | --- | --- |
271
+ | `vaultDeposit(options)` | Deposit into a Stellar vault |
272
+ | `vaultRedeem(options)` | Redeem from a Stellar vault |
273
+ | `submitTransaction(signedXdr)` | Submit a signed XDR transaction |
274
+ | `getUserPosition(options)` | User position in a Stellar vault |
275
+ | `convertToShares(options)` | Convert an asset amount to shares |
276
+
277
+ ### Sui Adapter (`sdk.sui`)
278
+
279
+ | Method | Description |
280
+ | --- | --- |
281
+ | `getEmberVaults()` | List all Ember (Sui) vaults |
282
+ | `getEmberTVL(limit?)` | Total value locked across Ember vaults |
283
+
284
+ ## Code Conventions
285
+
286
+ ### Naming Patterns
287
+
288
+ - **Interfaces**: Prefixed with `I` (e.g., `IVault`, `IVaultLoan`)
289
+ - **ABIs**: Prefixed with `ABI_` (e.g., `ABI_LENDING_POOL_V2`)
290
+ - **Types**: Descriptive names (e.g., `IAddress`, `IChainId`)
291
+
292
+ ### Special Comment Tags
293
+
294
+ Search the codebase for these to find important areas:
295
+
296
+ - `@todo`: Planned improvements or missing features
297
+ - `@hardcoded`: Hardcoded values that may need configuration
298
+ - `@solana`: Solana-specific logic or notes
299
+
300
+ ### Error Handling
301
+
302
+ Every public method throws typed errors that subclass `AugustSDKError`:
303
+
304
+ ```typescript
305
+ import { AugustValidationError, AugustTimeoutError, AugustSDKError } from '@augustdigital/sdk';
306
+
307
+ try {
308
+ await sdk.evm.vaultDeposit({ target: '0x...', wallet: owner, amount: '1' });
309
+ } catch (err) {
310
+ if (err instanceof AugustValidationError) showFormError(err.message);
311
+ else if (err instanceof AugustTimeoutError) scheduleRetry(err.timeoutMs);
312
+ else if (err instanceof AugustSDKError) reportError(err.code, err.cause);
313
+ else throw err;
314
+ }
315
+ ```
316
+
317
+ - Automatic retry with exponential backoff for network errors
318
+ - 90-second request timeout (configurable via `REQUEST_TIMEOUT_MS`)
319
+ - Correlation IDs in errors for debugging
320
+
321
+ ### Environment Configuration
322
+
323
+ ```typescript
324
+ // Development mode — enables console logging
325
+ const sdk = new AugustSDK({ appName: 'my-app', providers: { /* ... */ }, monitoring: { env: 'DEV' } });
326
+
327
+ // Production mode — default, no console logs
328
+ const sdk = new AugustSDK({ appName: 'my-app', providers: { /* ... */ } });
329
+ ```
330
+
331
+ ## Development
332
+
333
+ ### Running Tests
334
+
335
+ ```bash
336
+ pnpm test
337
+ ```
338
+
339
+ ### Building
340
+
341
+ ```bash
342
+ pnpm build
343
+ ```
344
+
345
+ ## Support
346
+
347
+ - **Issues**: [GitHub Issues](https://github.com/fractal-protocol/js-sdk/issues)
348
+ - **Documentation**: [docs.augustdigital.io](https://docs.augustdigital.io/developers/javascript-sdk)
349
+ - **Example App**: [starter.upshift.finance](https://starter.upshift.finance/)
@@ -0,0 +1,28 @@
1
+ export declare const ABI_ADDRESS_RESOLVER: readonly [{
2
+ readonly name: "addr";
3
+ readonly type: "function";
4
+ readonly stateMutability: "view";
5
+ readonly inputs: readonly [{
6
+ readonly name: "name";
7
+ readonly type: "bytes32";
8
+ }];
9
+ readonly outputs: readonly [{
10
+ readonly name: "";
11
+ readonly type: "address";
12
+ }];
13
+ }, {
14
+ readonly name: "addr";
15
+ readonly type: "function";
16
+ readonly stateMutability: "view";
17
+ readonly inputs: readonly [{
18
+ readonly name: "name";
19
+ readonly type: "bytes32";
20
+ }, {
21
+ readonly name: "coinType";
22
+ readonly type: "uint256";
23
+ }];
24
+ readonly outputs: readonly [{
25
+ readonly name: "";
26
+ readonly type: "bytes";
27
+ }];
28
+ }];
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ABI_ADDRESS_RESOLVER = void 0;
4
+ exports.ABI_ADDRESS_RESOLVER = [
5
+ {
6
+ name: 'addr',
7
+ type: 'function',
8
+ stateMutability: 'view',
9
+ inputs: [{ name: 'name', type: 'bytes32' }],
10
+ outputs: [{ name: '', type: 'address' }],
11
+ },
12
+ {
13
+ name: 'addr',
14
+ type: 'function',
15
+ stateMutability: 'view',
16
+ inputs: [
17
+ { name: 'name', type: 'bytes32' },
18
+ { name: 'coinType', type: 'uint256' },
19
+ ],
20
+ outputs: [{ name: '', type: 'bytes' }],
21
+ },
22
+ ];
23
+ //# sourceMappingURL=AddressResolver.js.map
@@ -0,0 +1,87 @@
1
+ export declare const ABI_CHAINLINK_V3: readonly [{
2
+ readonly inputs: readonly [];
3
+ readonly name: "decimals";
4
+ readonly outputs: readonly [{
5
+ readonly internalType: "uint8";
6
+ readonly name: "";
7
+ readonly type: "uint8";
8
+ }];
9
+ readonly stateMutability: "view";
10
+ readonly type: "function";
11
+ }, {
12
+ readonly inputs: readonly [];
13
+ readonly name: "description";
14
+ readonly outputs: readonly [{
15
+ readonly internalType: "string";
16
+ readonly name: "";
17
+ readonly type: "string";
18
+ }];
19
+ readonly stateMutability: "view";
20
+ readonly type: "function";
21
+ }, {
22
+ readonly inputs: readonly [{
23
+ readonly internalType: "uint80";
24
+ readonly name: "_roundId";
25
+ readonly type: "uint80";
26
+ }];
27
+ readonly name: "getRoundData";
28
+ readonly outputs: readonly [{
29
+ readonly internalType: "uint80";
30
+ readonly name: "roundId";
31
+ readonly type: "uint80";
32
+ }, {
33
+ readonly internalType: "int256";
34
+ readonly name: "answer";
35
+ readonly type: "int256";
36
+ }, {
37
+ readonly internalType: "uint256";
38
+ readonly name: "startedAt";
39
+ readonly type: "uint256";
40
+ }, {
41
+ readonly internalType: "uint256";
42
+ readonly name: "updatedAt";
43
+ readonly type: "uint256";
44
+ }, {
45
+ readonly internalType: "uint80";
46
+ readonly name: "answeredInRound";
47
+ readonly type: "uint80";
48
+ }];
49
+ readonly stateMutability: "view";
50
+ readonly type: "function";
51
+ }, {
52
+ readonly inputs: readonly [];
53
+ readonly name: "latestRoundData";
54
+ readonly outputs: readonly [{
55
+ readonly internalType: "uint80";
56
+ readonly name: "roundId";
57
+ readonly type: "uint80";
58
+ }, {
59
+ readonly internalType: "int256";
60
+ readonly name: "answer";
61
+ readonly type: "int256";
62
+ }, {
63
+ readonly internalType: "uint256";
64
+ readonly name: "startedAt";
65
+ readonly type: "uint256";
66
+ }, {
67
+ readonly internalType: "uint256";
68
+ readonly name: "updatedAt";
69
+ readonly type: "uint256";
70
+ }, {
71
+ readonly internalType: "uint80";
72
+ readonly name: "answeredInRound";
73
+ readonly type: "uint80";
74
+ }];
75
+ readonly stateMutability: "view";
76
+ readonly type: "function";
77
+ }, {
78
+ readonly inputs: readonly [];
79
+ readonly name: "version";
80
+ readonly outputs: readonly [{
81
+ readonly internalType: "uint256";
82
+ readonly name: "";
83
+ readonly type: "uint256";
84
+ }];
85
+ readonly stateMutability: "view";
86
+ readonly type: "function";
87
+ }];
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ABI_CHAINLINK_V3 = void 0;
4
+ exports.ABI_CHAINLINK_V3 = [
5
+ {
6
+ inputs: [],
7
+ name: 'decimals',
8
+ outputs: [
9
+ {
10
+ internalType: 'uint8',
11
+ name: '',
12
+ type: 'uint8',
13
+ },
14
+ ],
15
+ stateMutability: 'view',
16
+ type: 'function',
17
+ },
18
+ {
19
+ inputs: [],
20
+ name: 'description',
21
+ outputs: [
22
+ {
23
+ internalType: 'string',
24
+ name: '',
25
+ type: 'string',
26
+ },
27
+ ],
28
+ stateMutability: 'view',
29
+ type: 'function',
30
+ },
31
+ {
32
+ inputs: [
33
+ {
34
+ internalType: 'uint80',
35
+ name: '_roundId',
36
+ type: 'uint80',
37
+ },
38
+ ],
39
+ name: 'getRoundData',
40
+ outputs: [
41
+ {
42
+ internalType: 'uint80',
43
+ name: 'roundId',
44
+ type: 'uint80',
45
+ },
46
+ {
47
+ internalType: 'int256',
48
+ name: 'answer',
49
+ type: 'int256',
50
+ },
51
+ {
52
+ internalType: 'uint256',
53
+ name: 'startedAt',
54
+ type: 'uint256',
55
+ },
56
+ {
57
+ internalType: 'uint256',
58
+ name: 'updatedAt',
59
+ type: 'uint256',
60
+ },
61
+ {
62
+ internalType: 'uint80',
63
+ name: 'answeredInRound',
64
+ type: 'uint80',
65
+ },
66
+ ],
67
+ stateMutability: 'view',
68
+ type: 'function',
69
+ },
70
+ {
71
+ inputs: [],
72
+ name: 'latestRoundData',
73
+ outputs: [
74
+ {
75
+ internalType: 'uint80',
76
+ name: 'roundId',
77
+ type: 'uint80',
78
+ },
79
+ {
80
+ internalType: 'int256',
81
+ name: 'answer',
82
+ type: 'int256',
83
+ },
84
+ {
85
+ internalType: 'uint256',
86
+ name: 'startedAt',
87
+ type: 'uint256',
88
+ },
89
+ {
90
+ internalType: 'uint256',
91
+ name: 'updatedAt',
92
+ type: 'uint256',
93
+ },
94
+ {
95
+ internalType: 'uint80',
96
+ name: 'answeredInRound',
97
+ type: 'uint80',
98
+ },
99
+ ],
100
+ stateMutability: 'view',
101
+ type: 'function',
102
+ },
103
+ {
104
+ inputs: [],
105
+ name: 'version',
106
+ outputs: [
107
+ {
108
+ internalType: 'uint256',
109
+ name: '',
110
+ type: 'uint256',
111
+ },
112
+ ],
113
+ stateMutability: 'view',
114
+ type: 'function',
115
+ },
116
+ ];
117
+ //# sourceMappingURL=ChainlinkV3.js.map