@circle-fin/app-kit 1.10.0 → 1.11.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 +34 -0
- package/bridge.cjs +74 -22
- package/bridge.d.cts +12 -1
- package/bridge.d.mts +12 -1
- package/bridge.d.ts +12 -1
- package/bridge.mjs +74 -22
- package/chains.cjs +11 -0
- package/chains.mjs +11 -0
- package/context.cjs +11 -0
- package/context.d.cts +12 -1
- package/context.d.mts +12 -1
- package/context.d.ts +12 -1
- package/context.mjs +11 -0
- package/earn.cjs +701 -49
- package/earn.d.cts +12 -1
- package/earn.d.mts +12 -1
- package/earn.d.ts +12 -1
- package/earn.mjs +701 -49
- package/estimateBridge.cjs +74 -22
- package/estimateBridge.d.cts +12 -1
- package/estimateBridge.d.mts +12 -1
- package/estimateBridge.d.ts +12 -1
- package/estimateBridge.mjs +74 -22
- package/estimateSwap.cjs +259 -30
- package/estimateSwap.d.cts +12 -1
- package/estimateSwap.d.mts +12 -1
- package/estimateSwap.d.ts +12 -1
- package/estimateSwap.mjs +259 -30
- package/index.cjs +539 -81
- package/index.d.cts +101 -7
- package/index.d.mts +101 -7
- package/index.d.ts +101 -7
- package/index.mjs +539 -81
- package/package.json +7 -6
- package/swap.cjs +259 -30
- package/swap.d.cts +12 -1
- package/swap.d.mts +12 -1
- package/swap.d.ts +12 -1
- package/swap.mjs +259 -30
- package/unifiedBalance.cjs +96 -26
- package/unifiedBalance.d.cts +28 -5
- package/unifiedBalance.d.mts +28 -5
- package/unifiedBalance.d.ts +28 -5
- package/unifiedBalance.mjs +96 -26
package/index.d.cts
CHANGED
|
@@ -14238,6 +14238,17 @@ interface SwapResult$1 {
|
|
|
14238
14238
|
* The transaction hash for the executed swap.
|
|
14239
14239
|
*/
|
|
14240
14240
|
readonly txHash: string;
|
|
14241
|
+
/**
|
|
14242
|
+
* Per-swap correlation id echoed back by the service (a UUID).
|
|
14243
|
+
*
|
|
14244
|
+
* @remarks
|
|
14245
|
+
* Attached to success telemetry so a swap can be correlated across records.
|
|
14246
|
+
* Present when the service response exposes it — currently every chain
|
|
14247
|
+
* (EVM + Solana); undefined only against an older service that omits it.
|
|
14248
|
+
* Internal telemetry detail — not part of the developer-facing result.
|
|
14249
|
+
* @internal
|
|
14250
|
+
*/
|
|
14251
|
+
readonly correlationId?: string;
|
|
14241
14252
|
/**
|
|
14242
14253
|
* Array of all transactions executed during the swap operation.
|
|
14243
14254
|
*
|
|
@@ -15787,6 +15798,19 @@ interface SwapKitConfig<TExtraProviders extends FlexibleSwappingProvider[] = []>
|
|
|
15787
15798
|
* for all swaps executed through the created context.
|
|
15788
15799
|
*/
|
|
15789
15800
|
customFeePolicy?: CustomFeePolicy$1;
|
|
15801
|
+
/**
|
|
15802
|
+
* Disable success/analytics telemetry.
|
|
15803
|
+
*
|
|
15804
|
+
* When `true`, the SDK will not POST success telemetry (the `swap_swap`
|
|
15805
|
+
* volume-attribution event emitted after a successful swap). Independent of
|
|
15806
|
+
* {@link SwapKitConfig.disableErrorReporting}, so analytics can be opted out
|
|
15807
|
+
* without silencing error reports. The events carry SDK metadata and
|
|
15808
|
+
* allowlisted operation context (chains, token symbols, txHash, correlation
|
|
15809
|
+
* id); they do not include wallet addresses or amounts. Defaults to `false`.
|
|
15810
|
+
*
|
|
15811
|
+
* @defaultValue false
|
|
15812
|
+
*/
|
|
15813
|
+
disableAnalytics?: boolean;
|
|
15790
15814
|
/**
|
|
15791
15815
|
* Disable error telemetry.
|
|
15792
15816
|
*
|
|
@@ -18539,6 +18563,27 @@ interface EarnKitContext<TProviders extends readonly FlexibleEarningProvider[] =
|
|
|
18539
18563
|
interface EarnKitConfig<TExtraProviders extends FlexibleEarningProvider[] = []> {
|
|
18540
18564
|
/** Optional array of custom earn providers. */
|
|
18541
18565
|
providers?: TExtraProviders;
|
|
18566
|
+
/**
|
|
18567
|
+
* Disable success telemetry for completed EarnKit operations.
|
|
18568
|
+
*
|
|
18569
|
+
* When `true`, direct {@link EarnKit} instances do not send success events
|
|
18570
|
+
* to Circle's telemetry endpoint for vault lookups, vault discovery,
|
|
18571
|
+
* deposits, withdrawals, or reward claims. The events include SDK metadata
|
|
18572
|
+
* and allowlisted operation context; they do not include wallet addresses or
|
|
18573
|
+
* amounts. Defaults to `false`.
|
|
18574
|
+
*
|
|
18575
|
+
* @defaultValue false
|
|
18576
|
+
*/
|
|
18577
|
+
disableAnalytics?: boolean;
|
|
18578
|
+
/**
|
|
18579
|
+
* Disable error telemetry for failed public operations.
|
|
18580
|
+
*
|
|
18581
|
+
* When `true`, direct {@link EarnKit} instances do not send structured
|
|
18582
|
+
* error details to Circle's telemetry endpoint. Defaults to `false`.
|
|
18583
|
+
*
|
|
18584
|
+
* @defaultValue false
|
|
18585
|
+
*/
|
|
18586
|
+
disableErrorReporting?: boolean;
|
|
18542
18587
|
}
|
|
18543
18588
|
|
|
18544
18589
|
/**
|
|
@@ -18600,6 +18645,10 @@ interface EarnKitConfig<TExtraProviders extends FlexibleEarningProvider[] = []>
|
|
|
18600
18645
|
*/
|
|
18601
18646
|
declare class EarnKit {
|
|
18602
18647
|
private readonly context;
|
|
18648
|
+
/** Per-kit identity and opt-out state for error telemetry. */
|
|
18649
|
+
private readonly telemetryConfig;
|
|
18650
|
+
/** Per-kit identity and opt-out state for success telemetry. */
|
|
18651
|
+
private readonly analyticsTelemetryConfig;
|
|
18603
18652
|
/**
|
|
18604
18653
|
* Event dispatcher for step-level events emitted during multi-phase earn
|
|
18605
18654
|
* operations. Prefer {@link EarnKit.on} / {@link EarnKit.off} over using
|
|
@@ -24739,10 +24788,21 @@ interface AppKitContext {
|
|
|
24739
24788
|
* ```
|
|
24740
24789
|
*/
|
|
24741
24790
|
actions: Record<'bridge' | 'earn', Record<string, ((payload: unknown) => void)[]>>;
|
|
24791
|
+
/**
|
|
24792
|
+
* Disable success analytics for the underlying EarnKit, SwapKit, and
|
|
24793
|
+
* UnifiedBalanceKit.
|
|
24794
|
+
*
|
|
24795
|
+
* When `true`, completed earn, swap, and unified balance operations will not
|
|
24796
|
+
* POST analytics events. This does not disable error reporting; use
|
|
24797
|
+
* {@link AppKitContext.disableErrorReporting} for that. Defaults to `false`.
|
|
24798
|
+
*
|
|
24799
|
+
* @defaultValue false
|
|
24800
|
+
*/
|
|
24801
|
+
disableAnalytics?: boolean;
|
|
24742
24802
|
/**
|
|
24743
24803
|
* Disable error telemetry for all sub-kits.
|
|
24744
24804
|
*
|
|
24745
|
-
* When `true`, none of the underlying kits (BridgeKit, SwapKit,
|
|
24805
|
+
* When `true`, none of the underlying kits (BridgeKit, SwapKit, EarnKit,
|
|
24746
24806
|
* UnifiedBalanceKit) will POST error details to the telemetry
|
|
24747
24807
|
* endpoint when operations throw. Defaults to `false` (enabled).
|
|
24748
24808
|
*
|
|
@@ -26509,10 +26569,13 @@ interface GetDelegateStatusParams<TAdapterCapabilities extends AdapterCapabiliti
|
|
|
26509
26569
|
}
|
|
26510
26570
|
|
|
26511
26571
|
/**
|
|
26512
|
-
* Parameters for initiating a delayed fund removal from a Gateway
|
|
26572
|
+
* Parameters for initiating a delayed recovery fund removal from a Gateway
|
|
26513
26573
|
* account.
|
|
26514
26574
|
*
|
|
26515
26575
|
* @remarks
|
|
26576
|
+
* Use fund removal only as a trustless fallback when the normal spend flow is
|
|
26577
|
+
* unavailable. For day-to-day movement out of a Unified Balance, use `spend`.
|
|
26578
|
+
*
|
|
26516
26579
|
* Fund removals have a mandatory 7-day delay before they can be
|
|
26517
26580
|
* completed. Only one removal may be pending per chain at a
|
|
26518
26581
|
* time. Initiating a second removal on the same chain adds the
|
|
@@ -26595,7 +26658,12 @@ interface InitiateRemoveFundResult {
|
|
|
26595
26658
|
explorerUrl?: string;
|
|
26596
26659
|
}
|
|
26597
26660
|
/**
|
|
26598
|
-
* Parameters for completing a fund removal after the
|
|
26661
|
+
* Parameters for completing a recovery fund removal after the withdrawal
|
|
26662
|
+
* delay.
|
|
26663
|
+
*
|
|
26664
|
+
* @remarks
|
|
26665
|
+
* Use fund removal only as a trustless fallback when the normal spend flow is
|
|
26666
|
+
* unavailable. For day-to-day movement out of a Unified Balance, use `spend`.
|
|
26599
26667
|
*
|
|
26600
26668
|
* @typeParam TAdapterCapabilities - Adapter capability constraints.
|
|
26601
26669
|
* @typeParam TChainIdentifier - Accepted chain identifier type.
|
|
@@ -26692,6 +26760,11 @@ interface GetSupportedChainsOptions {
|
|
|
26692
26760
|
* Internally holds a persistent {@link UnifiedBalanceKit} instance so that
|
|
26693
26761
|
* event dispatchers and custom fee policies are preserved across calls.
|
|
26694
26762
|
*
|
|
26763
|
+
* Use {@link AppKitUnifiedBalance.spend} for normal movement out of a Unified
|
|
26764
|
+
* Balance. {@link AppKitUnifiedBalance.removeFund} is a trustless recovery path
|
|
26765
|
+
* for situations where the normal spend flow is unavailable, and it requires a
|
|
26766
|
+
* 7-day withdrawal delay after {@link AppKitUnifiedBalance.initiateRemoveFund}.
|
|
26767
|
+
*
|
|
26695
26768
|
* @example
|
|
26696
26769
|
* ```typescript
|
|
26697
26770
|
* import { AppKit } from '@circle-fin/app-kit'
|
|
@@ -26893,7 +26966,12 @@ declare class AppKitUnifiedBalance {
|
|
|
26893
26966
|
*/
|
|
26894
26967
|
removeDelegate(params: UpdateDelegateParams): Promise<UpdateDelegateResult>;
|
|
26895
26968
|
/**
|
|
26896
|
-
*
|
|
26969
|
+
* Initiate a trustless recovery removal from an account.
|
|
26970
|
+
*
|
|
26971
|
+
* Use `spend` for normal movement out of a Unified Balance. `removeFund` is a
|
|
26972
|
+
* recovery path for situations where the normal spend flow is unavailable.
|
|
26973
|
+
* Calling this method starts the 7-day withdrawal delay before the removal can
|
|
26974
|
+
* be completed.
|
|
26897
26975
|
*
|
|
26898
26976
|
* @param params - The account owner's adapter context, amount, and token.
|
|
26899
26977
|
* @returns Promise resolving to the initiation details.
|
|
@@ -26911,11 +26989,16 @@ declare class AppKitUnifiedBalance {
|
|
|
26911
26989
|
*/
|
|
26912
26990
|
initiateRemoveFund(params: InitiateRemoveFundParams): Promise<InitiateRemoveFundResult>;
|
|
26913
26991
|
/**
|
|
26914
|
-
* Complete a
|
|
26992
|
+
* Complete a trustless recovery removal after the withdrawal delay.
|
|
26993
|
+
*
|
|
26994
|
+
* Use `spend` for normal movement out of a Unified Balance. `removeFund` is a
|
|
26995
|
+
* recovery path for situations where the normal spend flow is unavailable.
|
|
26996
|
+
* Both EVM and Solana removals require a 7-day withdrawal delay after
|
|
26997
|
+
* `initiateRemoveFund` before funds can be removed.
|
|
26915
26998
|
*
|
|
26916
26999
|
* @param params - The account owner context matching the original initiation.
|
|
26917
27000
|
* @returns Promise resolving to the fund removal details.
|
|
26918
|
-
* @throws {KitError} If the
|
|
27001
|
+
* @throws {KitError} If the withdrawal delay has not elapsed or the
|
|
26919
27002
|
* on-chain transaction fails.
|
|
26920
27003
|
*
|
|
26921
27004
|
* @example
|
|
@@ -27036,10 +27119,21 @@ type AppKitConfig = CreateContextParams & {
|
|
|
27036
27119
|
developerFee?: Partial<DeveloperFeeHooks>;
|
|
27037
27120
|
/** Optional config forwarded to the underlying {@link UnifiedBalanceKit}. */
|
|
27038
27121
|
unifiedBalance?: UnifiedBalanceKitConfig;
|
|
27122
|
+
/**
|
|
27123
|
+
* Disable success analytics for the underlying EarnKit, SwapKit, and
|
|
27124
|
+
* UnifiedBalanceKit.
|
|
27125
|
+
*
|
|
27126
|
+
* When `true`, completed earn, swap, and unified balance operations will not
|
|
27127
|
+
* POST analytics events. This does not disable error reporting; use
|
|
27128
|
+
* {@link AppKitConfig.disableErrorReporting} for that. Defaults to `false`.
|
|
27129
|
+
*
|
|
27130
|
+
* @defaultValue false
|
|
27131
|
+
*/
|
|
27132
|
+
disableAnalytics?: boolean;
|
|
27039
27133
|
/**
|
|
27040
27134
|
* Disable error telemetry for all underlying kits.
|
|
27041
27135
|
*
|
|
27042
|
-
* When `true`, BridgeKit, SwapKit, and UnifiedBalanceKit will not
|
|
27136
|
+
* When `true`, BridgeKit, SwapKit, EarnKit, and UnifiedBalanceKit will not
|
|
27043
27137
|
* POST error details to the telemetry endpoint. Defaults to `false`.
|
|
27044
27138
|
*
|
|
27045
27139
|
* @defaultValue false
|
package/index.d.mts
CHANGED
|
@@ -14238,6 +14238,17 @@ interface SwapResult$1 {
|
|
|
14238
14238
|
* The transaction hash for the executed swap.
|
|
14239
14239
|
*/
|
|
14240
14240
|
readonly txHash: string;
|
|
14241
|
+
/**
|
|
14242
|
+
* Per-swap correlation id echoed back by the service (a UUID).
|
|
14243
|
+
*
|
|
14244
|
+
* @remarks
|
|
14245
|
+
* Attached to success telemetry so a swap can be correlated across records.
|
|
14246
|
+
* Present when the service response exposes it — currently every chain
|
|
14247
|
+
* (EVM + Solana); undefined only against an older service that omits it.
|
|
14248
|
+
* Internal telemetry detail — not part of the developer-facing result.
|
|
14249
|
+
* @internal
|
|
14250
|
+
*/
|
|
14251
|
+
readonly correlationId?: string;
|
|
14241
14252
|
/**
|
|
14242
14253
|
* Array of all transactions executed during the swap operation.
|
|
14243
14254
|
*
|
|
@@ -15787,6 +15798,19 @@ interface SwapKitConfig<TExtraProviders extends FlexibleSwappingProvider[] = []>
|
|
|
15787
15798
|
* for all swaps executed through the created context.
|
|
15788
15799
|
*/
|
|
15789
15800
|
customFeePolicy?: CustomFeePolicy$1;
|
|
15801
|
+
/**
|
|
15802
|
+
* Disable success/analytics telemetry.
|
|
15803
|
+
*
|
|
15804
|
+
* When `true`, the SDK will not POST success telemetry (the `swap_swap`
|
|
15805
|
+
* volume-attribution event emitted after a successful swap). Independent of
|
|
15806
|
+
* {@link SwapKitConfig.disableErrorReporting}, so analytics can be opted out
|
|
15807
|
+
* without silencing error reports. The events carry SDK metadata and
|
|
15808
|
+
* allowlisted operation context (chains, token symbols, txHash, correlation
|
|
15809
|
+
* id); they do not include wallet addresses or amounts. Defaults to `false`.
|
|
15810
|
+
*
|
|
15811
|
+
* @defaultValue false
|
|
15812
|
+
*/
|
|
15813
|
+
disableAnalytics?: boolean;
|
|
15790
15814
|
/**
|
|
15791
15815
|
* Disable error telemetry.
|
|
15792
15816
|
*
|
|
@@ -18539,6 +18563,27 @@ interface EarnKitContext<TProviders extends readonly FlexibleEarningProvider[] =
|
|
|
18539
18563
|
interface EarnKitConfig<TExtraProviders extends FlexibleEarningProvider[] = []> {
|
|
18540
18564
|
/** Optional array of custom earn providers. */
|
|
18541
18565
|
providers?: TExtraProviders;
|
|
18566
|
+
/**
|
|
18567
|
+
* Disable success telemetry for completed EarnKit operations.
|
|
18568
|
+
*
|
|
18569
|
+
* When `true`, direct {@link EarnKit} instances do not send success events
|
|
18570
|
+
* to Circle's telemetry endpoint for vault lookups, vault discovery,
|
|
18571
|
+
* deposits, withdrawals, or reward claims. The events include SDK metadata
|
|
18572
|
+
* and allowlisted operation context; they do not include wallet addresses or
|
|
18573
|
+
* amounts. Defaults to `false`.
|
|
18574
|
+
*
|
|
18575
|
+
* @defaultValue false
|
|
18576
|
+
*/
|
|
18577
|
+
disableAnalytics?: boolean;
|
|
18578
|
+
/**
|
|
18579
|
+
* Disable error telemetry for failed public operations.
|
|
18580
|
+
*
|
|
18581
|
+
* When `true`, direct {@link EarnKit} instances do not send structured
|
|
18582
|
+
* error details to Circle's telemetry endpoint. Defaults to `false`.
|
|
18583
|
+
*
|
|
18584
|
+
* @defaultValue false
|
|
18585
|
+
*/
|
|
18586
|
+
disableErrorReporting?: boolean;
|
|
18542
18587
|
}
|
|
18543
18588
|
|
|
18544
18589
|
/**
|
|
@@ -18600,6 +18645,10 @@ interface EarnKitConfig<TExtraProviders extends FlexibleEarningProvider[] = []>
|
|
|
18600
18645
|
*/
|
|
18601
18646
|
declare class EarnKit {
|
|
18602
18647
|
private readonly context;
|
|
18648
|
+
/** Per-kit identity and opt-out state for error telemetry. */
|
|
18649
|
+
private readonly telemetryConfig;
|
|
18650
|
+
/** Per-kit identity and opt-out state for success telemetry. */
|
|
18651
|
+
private readonly analyticsTelemetryConfig;
|
|
18603
18652
|
/**
|
|
18604
18653
|
* Event dispatcher for step-level events emitted during multi-phase earn
|
|
18605
18654
|
* operations. Prefer {@link EarnKit.on} / {@link EarnKit.off} over using
|
|
@@ -24739,10 +24788,21 @@ interface AppKitContext {
|
|
|
24739
24788
|
* ```
|
|
24740
24789
|
*/
|
|
24741
24790
|
actions: Record<'bridge' | 'earn', Record<string, ((payload: unknown) => void)[]>>;
|
|
24791
|
+
/**
|
|
24792
|
+
* Disable success analytics for the underlying EarnKit, SwapKit, and
|
|
24793
|
+
* UnifiedBalanceKit.
|
|
24794
|
+
*
|
|
24795
|
+
* When `true`, completed earn, swap, and unified balance operations will not
|
|
24796
|
+
* POST analytics events. This does not disable error reporting; use
|
|
24797
|
+
* {@link AppKitContext.disableErrorReporting} for that. Defaults to `false`.
|
|
24798
|
+
*
|
|
24799
|
+
* @defaultValue false
|
|
24800
|
+
*/
|
|
24801
|
+
disableAnalytics?: boolean;
|
|
24742
24802
|
/**
|
|
24743
24803
|
* Disable error telemetry for all sub-kits.
|
|
24744
24804
|
*
|
|
24745
|
-
* When `true`, none of the underlying kits (BridgeKit, SwapKit,
|
|
24805
|
+
* When `true`, none of the underlying kits (BridgeKit, SwapKit, EarnKit,
|
|
24746
24806
|
* UnifiedBalanceKit) will POST error details to the telemetry
|
|
24747
24807
|
* endpoint when operations throw. Defaults to `false` (enabled).
|
|
24748
24808
|
*
|
|
@@ -26509,10 +26569,13 @@ interface GetDelegateStatusParams<TAdapterCapabilities extends AdapterCapabiliti
|
|
|
26509
26569
|
}
|
|
26510
26570
|
|
|
26511
26571
|
/**
|
|
26512
|
-
* Parameters for initiating a delayed fund removal from a Gateway
|
|
26572
|
+
* Parameters for initiating a delayed recovery fund removal from a Gateway
|
|
26513
26573
|
* account.
|
|
26514
26574
|
*
|
|
26515
26575
|
* @remarks
|
|
26576
|
+
* Use fund removal only as a trustless fallback when the normal spend flow is
|
|
26577
|
+
* unavailable. For day-to-day movement out of a Unified Balance, use `spend`.
|
|
26578
|
+
*
|
|
26516
26579
|
* Fund removals have a mandatory 7-day delay before they can be
|
|
26517
26580
|
* completed. Only one removal may be pending per chain at a
|
|
26518
26581
|
* time. Initiating a second removal on the same chain adds the
|
|
@@ -26595,7 +26658,12 @@ interface InitiateRemoveFundResult {
|
|
|
26595
26658
|
explorerUrl?: string;
|
|
26596
26659
|
}
|
|
26597
26660
|
/**
|
|
26598
|
-
* Parameters for completing a fund removal after the
|
|
26661
|
+
* Parameters for completing a recovery fund removal after the withdrawal
|
|
26662
|
+
* delay.
|
|
26663
|
+
*
|
|
26664
|
+
* @remarks
|
|
26665
|
+
* Use fund removal only as a trustless fallback when the normal spend flow is
|
|
26666
|
+
* unavailable. For day-to-day movement out of a Unified Balance, use `spend`.
|
|
26599
26667
|
*
|
|
26600
26668
|
* @typeParam TAdapterCapabilities - Adapter capability constraints.
|
|
26601
26669
|
* @typeParam TChainIdentifier - Accepted chain identifier type.
|
|
@@ -26692,6 +26760,11 @@ interface GetSupportedChainsOptions {
|
|
|
26692
26760
|
* Internally holds a persistent {@link UnifiedBalanceKit} instance so that
|
|
26693
26761
|
* event dispatchers and custom fee policies are preserved across calls.
|
|
26694
26762
|
*
|
|
26763
|
+
* Use {@link AppKitUnifiedBalance.spend} for normal movement out of a Unified
|
|
26764
|
+
* Balance. {@link AppKitUnifiedBalance.removeFund} is a trustless recovery path
|
|
26765
|
+
* for situations where the normal spend flow is unavailable, and it requires a
|
|
26766
|
+
* 7-day withdrawal delay after {@link AppKitUnifiedBalance.initiateRemoveFund}.
|
|
26767
|
+
*
|
|
26695
26768
|
* @example
|
|
26696
26769
|
* ```typescript
|
|
26697
26770
|
* import { AppKit } from '@circle-fin/app-kit'
|
|
@@ -26893,7 +26966,12 @@ declare class AppKitUnifiedBalance {
|
|
|
26893
26966
|
*/
|
|
26894
26967
|
removeDelegate(params: UpdateDelegateParams): Promise<UpdateDelegateResult>;
|
|
26895
26968
|
/**
|
|
26896
|
-
*
|
|
26969
|
+
* Initiate a trustless recovery removal from an account.
|
|
26970
|
+
*
|
|
26971
|
+
* Use `spend` for normal movement out of a Unified Balance. `removeFund` is a
|
|
26972
|
+
* recovery path for situations where the normal spend flow is unavailable.
|
|
26973
|
+
* Calling this method starts the 7-day withdrawal delay before the removal can
|
|
26974
|
+
* be completed.
|
|
26897
26975
|
*
|
|
26898
26976
|
* @param params - The account owner's adapter context, amount, and token.
|
|
26899
26977
|
* @returns Promise resolving to the initiation details.
|
|
@@ -26911,11 +26989,16 @@ declare class AppKitUnifiedBalance {
|
|
|
26911
26989
|
*/
|
|
26912
26990
|
initiateRemoveFund(params: InitiateRemoveFundParams): Promise<InitiateRemoveFundResult>;
|
|
26913
26991
|
/**
|
|
26914
|
-
* Complete a
|
|
26992
|
+
* Complete a trustless recovery removal after the withdrawal delay.
|
|
26993
|
+
*
|
|
26994
|
+
* Use `spend` for normal movement out of a Unified Balance. `removeFund` is a
|
|
26995
|
+
* recovery path for situations where the normal spend flow is unavailable.
|
|
26996
|
+
* Both EVM and Solana removals require a 7-day withdrawal delay after
|
|
26997
|
+
* `initiateRemoveFund` before funds can be removed.
|
|
26915
26998
|
*
|
|
26916
26999
|
* @param params - The account owner context matching the original initiation.
|
|
26917
27000
|
* @returns Promise resolving to the fund removal details.
|
|
26918
|
-
* @throws {KitError} If the
|
|
27001
|
+
* @throws {KitError} If the withdrawal delay has not elapsed or the
|
|
26919
27002
|
* on-chain transaction fails.
|
|
26920
27003
|
*
|
|
26921
27004
|
* @example
|
|
@@ -27036,10 +27119,21 @@ type AppKitConfig = CreateContextParams & {
|
|
|
27036
27119
|
developerFee?: Partial<DeveloperFeeHooks>;
|
|
27037
27120
|
/** Optional config forwarded to the underlying {@link UnifiedBalanceKit}. */
|
|
27038
27121
|
unifiedBalance?: UnifiedBalanceKitConfig;
|
|
27122
|
+
/**
|
|
27123
|
+
* Disable success analytics for the underlying EarnKit, SwapKit, and
|
|
27124
|
+
* UnifiedBalanceKit.
|
|
27125
|
+
*
|
|
27126
|
+
* When `true`, completed earn, swap, and unified balance operations will not
|
|
27127
|
+
* POST analytics events. This does not disable error reporting; use
|
|
27128
|
+
* {@link AppKitConfig.disableErrorReporting} for that. Defaults to `false`.
|
|
27129
|
+
*
|
|
27130
|
+
* @defaultValue false
|
|
27131
|
+
*/
|
|
27132
|
+
disableAnalytics?: boolean;
|
|
27039
27133
|
/**
|
|
27040
27134
|
* Disable error telemetry for all underlying kits.
|
|
27041
27135
|
*
|
|
27042
|
-
* When `true`, BridgeKit, SwapKit, and UnifiedBalanceKit will not
|
|
27136
|
+
* When `true`, BridgeKit, SwapKit, EarnKit, and UnifiedBalanceKit will not
|
|
27043
27137
|
* POST error details to the telemetry endpoint. Defaults to `false`.
|
|
27044
27138
|
*
|
|
27045
27139
|
* @defaultValue false
|
package/index.d.ts
CHANGED
|
@@ -14238,6 +14238,17 @@ interface SwapResult$1 {
|
|
|
14238
14238
|
* The transaction hash for the executed swap.
|
|
14239
14239
|
*/
|
|
14240
14240
|
readonly txHash: string;
|
|
14241
|
+
/**
|
|
14242
|
+
* Per-swap correlation id echoed back by the service (a UUID).
|
|
14243
|
+
*
|
|
14244
|
+
* @remarks
|
|
14245
|
+
* Attached to success telemetry so a swap can be correlated across records.
|
|
14246
|
+
* Present when the service response exposes it — currently every chain
|
|
14247
|
+
* (EVM + Solana); undefined only against an older service that omits it.
|
|
14248
|
+
* Internal telemetry detail — not part of the developer-facing result.
|
|
14249
|
+
* @internal
|
|
14250
|
+
*/
|
|
14251
|
+
readonly correlationId?: string;
|
|
14241
14252
|
/**
|
|
14242
14253
|
* Array of all transactions executed during the swap operation.
|
|
14243
14254
|
*
|
|
@@ -15787,6 +15798,19 @@ interface SwapKitConfig<TExtraProviders extends FlexibleSwappingProvider[] = []>
|
|
|
15787
15798
|
* for all swaps executed through the created context.
|
|
15788
15799
|
*/
|
|
15789
15800
|
customFeePolicy?: CustomFeePolicy$1;
|
|
15801
|
+
/**
|
|
15802
|
+
* Disable success/analytics telemetry.
|
|
15803
|
+
*
|
|
15804
|
+
* When `true`, the SDK will not POST success telemetry (the `swap_swap`
|
|
15805
|
+
* volume-attribution event emitted after a successful swap). Independent of
|
|
15806
|
+
* {@link SwapKitConfig.disableErrorReporting}, so analytics can be opted out
|
|
15807
|
+
* without silencing error reports. The events carry SDK metadata and
|
|
15808
|
+
* allowlisted operation context (chains, token symbols, txHash, correlation
|
|
15809
|
+
* id); they do not include wallet addresses or amounts. Defaults to `false`.
|
|
15810
|
+
*
|
|
15811
|
+
* @defaultValue false
|
|
15812
|
+
*/
|
|
15813
|
+
disableAnalytics?: boolean;
|
|
15790
15814
|
/**
|
|
15791
15815
|
* Disable error telemetry.
|
|
15792
15816
|
*
|
|
@@ -18539,6 +18563,27 @@ interface EarnKitContext<TProviders extends readonly FlexibleEarningProvider[] =
|
|
|
18539
18563
|
interface EarnKitConfig<TExtraProviders extends FlexibleEarningProvider[] = []> {
|
|
18540
18564
|
/** Optional array of custom earn providers. */
|
|
18541
18565
|
providers?: TExtraProviders;
|
|
18566
|
+
/**
|
|
18567
|
+
* Disable success telemetry for completed EarnKit operations.
|
|
18568
|
+
*
|
|
18569
|
+
* When `true`, direct {@link EarnKit} instances do not send success events
|
|
18570
|
+
* to Circle's telemetry endpoint for vault lookups, vault discovery,
|
|
18571
|
+
* deposits, withdrawals, or reward claims. The events include SDK metadata
|
|
18572
|
+
* and allowlisted operation context; they do not include wallet addresses or
|
|
18573
|
+
* amounts. Defaults to `false`.
|
|
18574
|
+
*
|
|
18575
|
+
* @defaultValue false
|
|
18576
|
+
*/
|
|
18577
|
+
disableAnalytics?: boolean;
|
|
18578
|
+
/**
|
|
18579
|
+
* Disable error telemetry for failed public operations.
|
|
18580
|
+
*
|
|
18581
|
+
* When `true`, direct {@link EarnKit} instances do not send structured
|
|
18582
|
+
* error details to Circle's telemetry endpoint. Defaults to `false`.
|
|
18583
|
+
*
|
|
18584
|
+
* @defaultValue false
|
|
18585
|
+
*/
|
|
18586
|
+
disableErrorReporting?: boolean;
|
|
18542
18587
|
}
|
|
18543
18588
|
|
|
18544
18589
|
/**
|
|
@@ -18600,6 +18645,10 @@ interface EarnKitConfig<TExtraProviders extends FlexibleEarningProvider[] = []>
|
|
|
18600
18645
|
*/
|
|
18601
18646
|
declare class EarnKit {
|
|
18602
18647
|
private readonly context;
|
|
18648
|
+
/** Per-kit identity and opt-out state for error telemetry. */
|
|
18649
|
+
private readonly telemetryConfig;
|
|
18650
|
+
/** Per-kit identity and opt-out state for success telemetry. */
|
|
18651
|
+
private readonly analyticsTelemetryConfig;
|
|
18603
18652
|
/**
|
|
18604
18653
|
* Event dispatcher for step-level events emitted during multi-phase earn
|
|
18605
18654
|
* operations. Prefer {@link EarnKit.on} / {@link EarnKit.off} over using
|
|
@@ -24739,10 +24788,21 @@ interface AppKitContext {
|
|
|
24739
24788
|
* ```
|
|
24740
24789
|
*/
|
|
24741
24790
|
actions: Record<'bridge' | 'earn', Record<string, ((payload: unknown) => void)[]>>;
|
|
24791
|
+
/**
|
|
24792
|
+
* Disable success analytics for the underlying EarnKit, SwapKit, and
|
|
24793
|
+
* UnifiedBalanceKit.
|
|
24794
|
+
*
|
|
24795
|
+
* When `true`, completed earn, swap, and unified balance operations will not
|
|
24796
|
+
* POST analytics events. This does not disable error reporting; use
|
|
24797
|
+
* {@link AppKitContext.disableErrorReporting} for that. Defaults to `false`.
|
|
24798
|
+
*
|
|
24799
|
+
* @defaultValue false
|
|
24800
|
+
*/
|
|
24801
|
+
disableAnalytics?: boolean;
|
|
24742
24802
|
/**
|
|
24743
24803
|
* Disable error telemetry for all sub-kits.
|
|
24744
24804
|
*
|
|
24745
|
-
* When `true`, none of the underlying kits (BridgeKit, SwapKit,
|
|
24805
|
+
* When `true`, none of the underlying kits (BridgeKit, SwapKit, EarnKit,
|
|
24746
24806
|
* UnifiedBalanceKit) will POST error details to the telemetry
|
|
24747
24807
|
* endpoint when operations throw. Defaults to `false` (enabled).
|
|
24748
24808
|
*
|
|
@@ -26509,10 +26569,13 @@ interface GetDelegateStatusParams<TAdapterCapabilities extends AdapterCapabiliti
|
|
|
26509
26569
|
}
|
|
26510
26570
|
|
|
26511
26571
|
/**
|
|
26512
|
-
* Parameters for initiating a delayed fund removal from a Gateway
|
|
26572
|
+
* Parameters for initiating a delayed recovery fund removal from a Gateway
|
|
26513
26573
|
* account.
|
|
26514
26574
|
*
|
|
26515
26575
|
* @remarks
|
|
26576
|
+
* Use fund removal only as a trustless fallback when the normal spend flow is
|
|
26577
|
+
* unavailable. For day-to-day movement out of a Unified Balance, use `spend`.
|
|
26578
|
+
*
|
|
26516
26579
|
* Fund removals have a mandatory 7-day delay before they can be
|
|
26517
26580
|
* completed. Only one removal may be pending per chain at a
|
|
26518
26581
|
* time. Initiating a second removal on the same chain adds the
|
|
@@ -26595,7 +26658,12 @@ interface InitiateRemoveFundResult {
|
|
|
26595
26658
|
explorerUrl?: string;
|
|
26596
26659
|
}
|
|
26597
26660
|
/**
|
|
26598
|
-
* Parameters for completing a fund removal after the
|
|
26661
|
+
* Parameters for completing a recovery fund removal after the withdrawal
|
|
26662
|
+
* delay.
|
|
26663
|
+
*
|
|
26664
|
+
* @remarks
|
|
26665
|
+
* Use fund removal only as a trustless fallback when the normal spend flow is
|
|
26666
|
+
* unavailable. For day-to-day movement out of a Unified Balance, use `spend`.
|
|
26599
26667
|
*
|
|
26600
26668
|
* @typeParam TAdapterCapabilities - Adapter capability constraints.
|
|
26601
26669
|
* @typeParam TChainIdentifier - Accepted chain identifier type.
|
|
@@ -26692,6 +26760,11 @@ interface GetSupportedChainsOptions {
|
|
|
26692
26760
|
* Internally holds a persistent {@link UnifiedBalanceKit} instance so that
|
|
26693
26761
|
* event dispatchers and custom fee policies are preserved across calls.
|
|
26694
26762
|
*
|
|
26763
|
+
* Use {@link AppKitUnifiedBalance.spend} for normal movement out of a Unified
|
|
26764
|
+
* Balance. {@link AppKitUnifiedBalance.removeFund} is a trustless recovery path
|
|
26765
|
+
* for situations where the normal spend flow is unavailable, and it requires a
|
|
26766
|
+
* 7-day withdrawal delay after {@link AppKitUnifiedBalance.initiateRemoveFund}.
|
|
26767
|
+
*
|
|
26695
26768
|
* @example
|
|
26696
26769
|
* ```typescript
|
|
26697
26770
|
* import { AppKit } from '@circle-fin/app-kit'
|
|
@@ -26893,7 +26966,12 @@ declare class AppKitUnifiedBalance {
|
|
|
26893
26966
|
*/
|
|
26894
26967
|
removeDelegate(params: UpdateDelegateParams): Promise<UpdateDelegateResult>;
|
|
26895
26968
|
/**
|
|
26896
|
-
*
|
|
26969
|
+
* Initiate a trustless recovery removal from an account.
|
|
26970
|
+
*
|
|
26971
|
+
* Use `spend` for normal movement out of a Unified Balance. `removeFund` is a
|
|
26972
|
+
* recovery path for situations where the normal spend flow is unavailable.
|
|
26973
|
+
* Calling this method starts the 7-day withdrawal delay before the removal can
|
|
26974
|
+
* be completed.
|
|
26897
26975
|
*
|
|
26898
26976
|
* @param params - The account owner's adapter context, amount, and token.
|
|
26899
26977
|
* @returns Promise resolving to the initiation details.
|
|
@@ -26911,11 +26989,16 @@ declare class AppKitUnifiedBalance {
|
|
|
26911
26989
|
*/
|
|
26912
26990
|
initiateRemoveFund(params: InitiateRemoveFundParams): Promise<InitiateRemoveFundResult>;
|
|
26913
26991
|
/**
|
|
26914
|
-
* Complete a
|
|
26992
|
+
* Complete a trustless recovery removal after the withdrawal delay.
|
|
26993
|
+
*
|
|
26994
|
+
* Use `spend` for normal movement out of a Unified Balance. `removeFund` is a
|
|
26995
|
+
* recovery path for situations where the normal spend flow is unavailable.
|
|
26996
|
+
* Both EVM and Solana removals require a 7-day withdrawal delay after
|
|
26997
|
+
* `initiateRemoveFund` before funds can be removed.
|
|
26915
26998
|
*
|
|
26916
26999
|
* @param params - The account owner context matching the original initiation.
|
|
26917
27000
|
* @returns Promise resolving to the fund removal details.
|
|
26918
|
-
* @throws {KitError} If the
|
|
27001
|
+
* @throws {KitError} If the withdrawal delay has not elapsed or the
|
|
26919
27002
|
* on-chain transaction fails.
|
|
26920
27003
|
*
|
|
26921
27004
|
* @example
|
|
@@ -27036,10 +27119,21 @@ type AppKitConfig = CreateContextParams & {
|
|
|
27036
27119
|
developerFee?: Partial<DeveloperFeeHooks>;
|
|
27037
27120
|
/** Optional config forwarded to the underlying {@link UnifiedBalanceKit}. */
|
|
27038
27121
|
unifiedBalance?: UnifiedBalanceKitConfig;
|
|
27122
|
+
/**
|
|
27123
|
+
* Disable success analytics for the underlying EarnKit, SwapKit, and
|
|
27124
|
+
* UnifiedBalanceKit.
|
|
27125
|
+
*
|
|
27126
|
+
* When `true`, completed earn, swap, and unified balance operations will not
|
|
27127
|
+
* POST analytics events. This does not disable error reporting; use
|
|
27128
|
+
* {@link AppKitConfig.disableErrorReporting} for that. Defaults to `false`.
|
|
27129
|
+
*
|
|
27130
|
+
* @defaultValue false
|
|
27131
|
+
*/
|
|
27132
|
+
disableAnalytics?: boolean;
|
|
27039
27133
|
/**
|
|
27040
27134
|
* Disable error telemetry for all underlying kits.
|
|
27041
27135
|
*
|
|
27042
|
-
* When `true`, BridgeKit, SwapKit, and UnifiedBalanceKit will not
|
|
27136
|
+
* When `true`, BridgeKit, SwapKit, EarnKit, and UnifiedBalanceKit will not
|
|
27043
27137
|
* POST error details to the telemetry endpoint. Defaults to `false`.
|
|
27044
27138
|
*
|
|
27045
27139
|
* @defaultValue false
|