@circle-fin/app-kit 1.15.2 → 1.16.0

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 (60) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/README.md +5 -2
  3. package/borrow.cjs +28028 -0
  4. package/borrow.cjs.map +1 -0
  5. package/borrow.d.cts +10723 -0
  6. package/borrow.d.mts +10723 -0
  7. package/borrow.d.ts +10723 -0
  8. package/borrow.mjs +28000 -0
  9. package/borrow.mjs.map +1 -0
  10. package/bridge.cjs +1942 -290
  11. package/bridge.d.cts +157 -12
  12. package/bridge.d.mts +157 -12
  13. package/bridge.d.ts +157 -12
  14. package/bridge.mjs +1942 -290
  15. package/chains.cjs +70 -3
  16. package/chains.d.cts +2 -0
  17. package/chains.d.mts +2 -0
  18. package/chains.d.ts +2 -0
  19. package/chains.mjs +70 -3
  20. package/context.cjs +1 -0
  21. package/context.d.cts +157 -12
  22. package/context.d.mts +157 -12
  23. package/context.d.ts +157 -12
  24. package/context.mjs +1 -0
  25. package/earn.cjs +5466 -3459
  26. package/earn.d.cts +1112 -983
  27. package/earn.d.mts +1112 -983
  28. package/earn.d.ts +1112 -983
  29. package/earn.mjs +5466 -3459
  30. package/estimateBridge.cjs +1940 -288
  31. package/estimateBridge.d.cts +157 -12
  32. package/estimateBridge.d.mts +157 -12
  33. package/estimateBridge.d.ts +157 -12
  34. package/estimateBridge.mjs +1940 -288
  35. package/estimateSwap.cjs +8497 -6831
  36. package/estimateSwap.d.cts +157 -12
  37. package/estimateSwap.d.mts +157 -12
  38. package/estimateSwap.d.ts +157 -12
  39. package/estimateSwap.mjs +8498 -6832
  40. package/index.cjs +30741 -18498
  41. package/index.d.cts +22724 -2322
  42. package/index.d.mts +22724 -2322
  43. package/index.d.ts +22724 -2322
  44. package/index.mjs +30682 -18492
  45. package/package.json +17 -7
  46. package/server.cjs +113 -22
  47. package/server.d.cts +10 -9
  48. package/server.d.mts +10 -9
  49. package/server.d.ts +10 -9
  50. package/server.mjs +113 -22
  51. package/swap.cjs +8497 -6831
  52. package/swap.d.cts +157 -12
  53. package/swap.d.mts +157 -12
  54. package/swap.d.ts +157 -12
  55. package/swap.mjs +8498 -6832
  56. package/unifiedBalance.cjs +457 -128
  57. package/unifiedBalance.d.cts +108 -11
  58. package/unifiedBalance.d.mts +108 -11
  59. package/unifiedBalance.d.ts +108 -11
  60. package/unifiedBalance.mjs +457 -128
package/CHANGELOG.md CHANGED
@@ -1,5 +1,64 @@
1
1
  # @circle-fin/app-kit
2
2
 
3
+ ## 1.16.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Add Borrow Kit to App Kit under `kit.borrow`:
8
+
9
+ ```ts
10
+ import { AppKit, BorrowChain } from "@circle-fin/app-kit";
11
+
12
+ const kit = new AppKit();
13
+
14
+ const result = await kit.borrow.borrow({
15
+ from: { adapter, chain: BorrowChain.Arc },
16
+ marketId: "0x...",
17
+ borrowAmount: "100",
18
+ });
19
+ ```
20
+
21
+ - Every Borrow Kit operation except `getSupportedChains` is available on
22
+ `kit.borrow`, including `retry`, and forwards App Kit's `disableAnalytics`
23
+ and `disableErrorReporting`.
24
+ - List borrow chains with `kit.getSupportedChains('borrow')`. Calling
25
+ `kit.getSupportedChains()` with no operation type now includes them, and
26
+ the standalone operation is exported as `borrowGetSupportedChains`.
27
+ - Borrow step events are namespaced: `kit.on('borrow.execute', handler)` and
28
+ `kit.on('*', handler)` both receive borrow progress.
29
+ - `@circle-fin/app-kit/borrow` exports the same operations as standalone
30
+ functions for tree-shaking.
31
+ - Borrow Kit's types, schemas and standalone operations are re-exported from
32
+ the package root, prefixed with `Borrow` wherever the name does not already
33
+ contain it (for example `BorrowLoanInfo`, `borrowRepay`).
34
+
35
+ - Default the destination of FAST cross-chain deposits to Arc. When `config.transferSpeed` is `'FAST'` and `to` is omitted, `deposit`, `depositFor`, and `estimateDeposit` now credit the Gateway balance on `Arc` for mainnet sources and `Arc_Testnet` for testnet sources instead of throwing. Passing `to` explicitly still selects any other supported fast-finality destination, and `estimateDeposit` echoes the resolved `to` so `deposit({ ...estimate, from })` targets the same chain.
36
+
37
+ Setting `allowanceStrategy` on a FAST deposit now fails with "cannot be set for FAST cross-chain deposits". A STANDARD deposit that sets both `to` and `allowanceStrategy` now reports the invalid `to` instead.
38
+
39
+ ### Patch Changes
40
+
41
+ - Stop replacing a validation error with a `TypeError` when the rejected value
42
+ holds a `bigint`.
43
+
44
+ Building a validation error serializes the offending value into the message.
45
+ `JSON.stringify` refuses `bigint` and circular structures, so a value that
46
+ carried either — an on-chain read, or a transaction receipt log, both of which
47
+ routinely hold `bigint` fields — threw
48
+ `TypeError: Do not know how to serialize a BigInt` from inside the error
49
+ constructor. The real error never surfaced, and callers saw an unrelated crash
50
+ in its place.
51
+
52
+ Such values now render with their `bigint` fields as strings, and a value that
53
+ still cannot be serialized renders as `[unserializable object]`. The error's
54
+ `cause.trace.value` is unchanged and still carries the raw value.
55
+
56
+ ## 1.15.3
57
+
58
+ ### Patch Changes
59
+
60
+ - Internal dependency updates. No user-facing changes.
61
+
3
62
  ## 1.15.2
4
63
 
5
64
  ### Patch Changes
package/README.md CHANGED
@@ -266,7 +266,7 @@ console.log(
266
266
  Check which chains support specific operations:
267
267
 
268
268
  ```typescript
269
- // Get all chains (bridge, swap, earn, and unified balance)
269
+ // Get all chains (bridge, swap, earn, borrow, and unified balance)
270
270
  const allChains = kit.getSupportedChains()
271
271
 
272
272
  // Get all chains that support bridging
@@ -278,6 +278,9 @@ const swapChains = kit.getSupportedChains('swap')
278
278
  // Get chains that support earn vault operations
279
279
  const earnChains = kit.getSupportedChains('earn')
280
280
 
281
+ // Get chains that support borrow operations
282
+ const borrowChains = kit.getSupportedChains('borrow')
283
+
281
284
  // Get chains that support unified balance operations
282
285
  const ubChains = kit.getSupportedChains('unifiedBalance')
283
286
  ```
@@ -793,7 +796,7 @@ await kit.bridge({
793
796
  - `kit.getSwapStatus(params)` - Fetch the current status of a swap
794
797
  - `kit.waitForSwap(params)` - Poll until a swap reaches a terminal status
795
798
  - `kit.getTokenRates(params)` - Fetch cached token USD rates
796
- - `kit.getSupportedChains(operationType?)` - Query supported chains by operation type (`'bridge'`, `'swap'`, `'earn'`, `'unifiedBalance'`)
799
+ - `kit.getSupportedChains(operationType?)` - Query supported chains by operation type (`'bridge'`, `'swap'`, `'earn'`, `'borrow'`, `'unifiedBalance'`)
797
800
  - `kit.setCustomFeePolicy(policy)` - Set operation-scoped custom fee policies
798
801
  - `kit.removeCustomFeePolicy(operation)` - Remove an operation-scoped custom fee policy
799
802
  - `kit.on(event, handler)` - Listen to operation events