@circle-fin/app-kit 1.15.3 → 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.
- package/CHANGELOG.md +53 -0
- package/README.md +5 -2
- package/borrow.cjs +28028 -0
- package/borrow.cjs.map +1 -0
- package/borrow.d.cts +10723 -0
- package/borrow.d.mts +10723 -0
- package/borrow.d.ts +10723 -0
- package/borrow.mjs +28000 -0
- package/borrow.mjs.map +1 -0
- package/bridge.cjs +1885 -276
- package/bridge.d.cts +86 -12
- package/bridge.d.mts +86 -12
- package/bridge.d.ts +86 -12
- package/bridge.mjs +1885 -276
- package/chains.cjs +70 -3
- package/chains.d.cts +2 -0
- package/chains.d.mts +2 -0
- package/chains.d.ts +2 -0
- package/chains.mjs +70 -3
- package/context.cjs +1 -0
- package/context.d.cts +86 -12
- package/context.d.mts +86 -12
- package/context.d.ts +86 -12
- package/context.mjs +1 -0
- package/earn.cjs +4981 -3314
- package/earn.d.cts +1117 -981
- package/earn.d.mts +1117 -981
- package/earn.d.ts +1117 -981
- package/earn.mjs +4981 -3314
- package/estimateBridge.cjs +1883 -274
- package/estimateBridge.d.cts +86 -12
- package/estimateBridge.d.mts +86 -12
- package/estimateBridge.d.ts +86 -12
- package/estimateBridge.mjs +1883 -274
- package/estimateSwap.cjs +8554 -6931
- package/estimateSwap.d.cts +86 -12
- package/estimateSwap.d.mts +86 -12
- package/estimateSwap.d.ts +86 -12
- package/estimateSwap.mjs +8503 -6880
- package/index.cjs +30943 -18928
- package/index.d.cts +23051 -2742
- package/index.d.mts +23051 -2742
- package/index.d.ts +23051 -2742
- package/index.mjs +30884 -18922
- package/package.json +17 -7
- package/server.cjs +101 -6
- package/server.mjs +101 -6
- package/swap.cjs +8554 -6931
- package/swap.d.cts +86 -12
- package/swap.d.mts +86 -12
- package/swap.d.ts +86 -12
- package/swap.mjs +8503 -6880
- package/unifiedBalance.cjs +457 -128
- package/unifiedBalance.d.cts +108 -11
- package/unifiedBalance.d.mts +108 -11
- package/unifiedBalance.d.ts +108 -11
- package/unifiedBalance.mjs +457 -128
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,58 @@
|
|
|
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
|
+
|
|
3
56
|
## 1.15.3
|
|
4
57
|
|
|
5
58
|
### 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
|