@circle-fin/app-kit 1.1.0 → 1.2.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.
package/index.d.ts CHANGED
@@ -1387,7 +1387,7 @@ declare const Codex: {
1387
1387
  };
1388
1388
  readonly forwarderSupported: {
1389
1389
  readonly source: true;
1390
- readonly destination: false;
1390
+ readonly destination: true;
1391
1391
  };
1392
1392
  };
1393
1393
  readonly kitContracts: {
@@ -1430,7 +1430,7 @@ declare const CodexTestnet: {
1430
1430
  };
1431
1431
  readonly forwarderSupported: {
1432
1432
  readonly source: true;
1433
- readonly destination: false;
1433
+ readonly destination: true;
1434
1434
  };
1435
1435
  };
1436
1436
  readonly kitContracts: {
@@ -1692,7 +1692,7 @@ declare const HyperEVM: {
1692
1692
  };
1693
1693
  readonly chainId: 999;
1694
1694
  readonly isTestnet: false;
1695
- readonly explorerUrl: "https://hyperevmscan.io/tx/{hash}";
1695
+ readonly explorerUrl: "https://app.hyperliquid.xyz/explorer/tx/{hash}";
1696
1696
  readonly rpcEndpoints: readonly ["https://rpc.hyperliquid.xyz/evm"];
1697
1697
  readonly eurcAddress: null;
1698
1698
  readonly usdcAddress: "0xb88339CB7199b77E23DB6E890353E22632Ba630f";
@@ -1737,7 +1737,7 @@ declare const HyperEVMTestnet: {
1737
1737
  };
1738
1738
  readonly chainId: 998;
1739
1739
  readonly isTestnet: true;
1740
- readonly explorerUrl: "https://testnet.hyperliquid.xyz/explorer/tx/{hash}";
1740
+ readonly explorerUrl: "https://app.hyperliquid-testnet.xyz/explorer/tx/{hash}";
1741
1741
  readonly rpcEndpoints: readonly ["https://rpc.hyperliquid-testnet.xyz/evm"];
1742
1742
  readonly eurcAddress: null;
1743
1743
  readonly usdcAddress: "0x2B3370eE501B4a559b57D449569354196457D8Ab";
@@ -2377,7 +2377,7 @@ declare const Plume: {
2377
2377
  };
2378
2378
  readonly forwarderSupported: {
2379
2379
  readonly source: true;
2380
- readonly destination: false;
2380
+ readonly destination: true;
2381
2381
  };
2382
2382
  };
2383
2383
  readonly kitContracts: {
@@ -2422,7 +2422,7 @@ declare const PlumeTestnet: {
2422
2422
  };
2423
2423
  readonly forwarderSupported: {
2424
2424
  readonly source: true;
2425
- readonly destination: false;
2425
+ readonly destination: true;
2426
2426
  };
2427
2427
  };
2428
2428
  readonly kitContracts: {
@@ -2794,7 +2794,7 @@ declare const Solana: {
2794
2794
  };
2795
2795
  readonly forwarderSupported: {
2796
2796
  readonly source: true;
2797
- readonly destination: false;
2797
+ readonly destination: true;
2798
2798
  };
2799
2799
  };
2800
2800
  readonly kitContracts: {
@@ -2841,7 +2841,7 @@ declare const SolanaDevnet: {
2841
2841
  };
2842
2842
  readonly forwarderSupported: {
2843
2843
  readonly source: true;
2844
- readonly destination: false;
2844
+ readonly destination: true;
2845
2845
  };
2846
2846
  };
2847
2847
  readonly kitContracts: {
@@ -3197,7 +3197,7 @@ declare const XDC: {
3197
3197
  };
3198
3198
  readonly forwarderSupported: {
3199
3199
  readonly source: true;
3200
- readonly destination: false;
3200
+ readonly destination: true;
3201
3201
  };
3202
3202
  };
3203
3203
  readonly kitContracts: {
@@ -3241,7 +3241,7 @@ declare const XDCApothem: {
3241
3241
  };
3242
3242
  readonly forwarderSupported: {
3243
3243
  readonly source: true;
3244
- readonly destination: false;
3244
+ readonly destination: true;
3245
3245
  };
3246
3246
  };
3247
3247
  readonly kitContracts: {
@@ -3574,6 +3574,32 @@ interface EvmExecuteOverrides extends EvmEstimateOverrides {
3574
3574
  */
3575
3575
  nonce?: number;
3576
3576
  }
3577
+ /**
3578
+ * Raw EVM call data tuple for a single contract interaction.
3579
+ *
3580
+ * Represents the minimal data needed to submit an EVM transaction:
3581
+ * the target contract address, the ABI-encoded calldata, and an
3582
+ * optional native token value. Used by EIP-5792 batched execution
3583
+ * to compose multiple calls into a single `wallet_sendCalls` request.
3584
+ *
3585
+ * @interface EvmCallData
3586
+ *
3587
+ * @example
3588
+ * ```typescript
3589
+ * const callData: EvmCallData = {
3590
+ * to: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
3591
+ * data: '0x095ea7b3000000000000000000000000...',
3592
+ * }
3593
+ * ```
3594
+ */
3595
+ interface EvmCallData {
3596
+ /** The target contract address. */
3597
+ to: `0x${string}`;
3598
+ /** The ABI-encoded function calldata. */
3599
+ data: `0x${string}`;
3600
+ /** Optional native token value to send with the call. */
3601
+ value?: bigint | undefined;
3602
+ }
3577
3603
  /**
3578
3604
  * Prepared contract execution for EVM chains.
3579
3605
  *
@@ -3602,6 +3628,28 @@ interface EvmPreparedChainRequest {
3602
3628
  * @throws If the execution fails
3603
3629
  */
3604
3630
  execute(overrides?: EvmExecuteOverrides): Promise<string>;
3631
+ /**
3632
+ * Return the raw call tuple without executing or estimating.
3633
+ *
3634
+ * Expose the `{ to, data, value }` triple that would be sent on-chain so
3635
+ * callers can feed it into EIP-5792 `wallet_sendCalls` or other batching
3636
+ * mechanisms. This method is optional -- adapters that do not support
3637
+ * calldata extraction (e.g. Ethers v6) may omit it.
3638
+ *
3639
+ * @returns The raw EVM call data for this prepared request.
3640
+ * @throws Never — synchronous accessor with no failure path.
3641
+ * @since 2.0.0
3642
+ *
3643
+ * @example
3644
+ * ```typescript
3645
+ * const prepared = await adapter.prepare(params, ctx)
3646
+ * if (prepared.getCallData) {
3647
+ * const { to, data, value } = prepared.getCallData()
3648
+ * console.log('Target:', to, 'Data:', data)
3649
+ * }
3650
+ * ```
3651
+ */
3652
+ getCallData?(): EvmCallData;
3605
3653
  }
3606
3654
  /**
3607
3655
  * Union type for all supported prepared contract executions.
@@ -8316,6 +8364,21 @@ interface BridgeStep {
8316
8364
  * - `undefined`: Not applicable (non-mint steps)
8317
8365
  */
8318
8366
  forwarded?: boolean;
8367
+ /**
8368
+ * Whether this step was executed as part of an EIP-5792 batched
8369
+ * `wallet_sendCalls` request.
8370
+ *
8371
+ * - `true`: The step was included in a batched call bundle
8372
+ * - `undefined`: The step was executed individually (sequential flow)
8373
+ */
8374
+ batched?: boolean | undefined;
8375
+ /**
8376
+ * The wallet-assigned batch identifier from `wallet_sendCalls`.
8377
+ *
8378
+ * Present only when {@link batched} is `true`. Can be used with
8379
+ * `wallet_getCallsStatus` to query the status of the entire bundle.
8380
+ */
8381
+ batchId?: string | undefined;
8319
8382
  /** Optional human-readable error message */
8320
8383
  errorMessage?: string;
8321
8384
  /** Optional raw error object (can be Viem/Ethers/Chain error) */
@@ -8460,6 +8523,24 @@ interface BridgeConfig {
8460
8523
  * @defaultValue TransferSpeed.FAST
8461
8524
  */
8462
8525
  transferSpeed?: TransferSpeed | `${TransferSpeed}` | undefined;
8526
+ /**
8527
+ * Enable or disable EIP-5792 batched transaction execution.
8528
+ *
8529
+ * When `true` (or `undefined` / omitted), the bridge will attempt to batch
8530
+ * the approve and burn calls into a single `wallet_sendCalls` request if
8531
+ * the connected wallet supports it. Set to `false` to explicitly opt out
8532
+ * and always use the sequential approve -> burn flow.
8533
+ *
8534
+ * @defaultValue `undefined` (batching attempted when the wallet supports it)
8535
+ *
8536
+ * @example
8537
+ * ```typescript
8538
+ * const config: BridgeConfig = {
8539
+ * batchTransactions: false, // force sequential flow
8540
+ * }
8541
+ * ```
8542
+ */
8543
+ batchTransactions?: boolean | undefined;
8463
8544
  /**
8464
8545
  * The maximum fee to pay for the burn operation.
8465
8546
  *
@@ -12506,34 +12587,34 @@ type ActionHandler<T extends {
12506
12587
  * Parameters for sending USDC, USDT, native tokens, or custom ERC-20/SPL tokens.
12507
12588
  *
12508
12589
  * This interface is the canonical input for send operations in App Kit. It supports
12509
- * sending to either a destination {@link AdapterContext} (recipient derives from the adapter's
12510
- * default account) or an explicit recipient `string` address on the destination chain.
12590
+ * sending to either a destination {@link Adapter} (recipient derives from the adapter's
12591
+ * default account) or an explicit recipient `string` address.
12511
12592
  *
12512
12593
  * - The `from` field provides the source signing context and chain.
12513
- * - The `to` field identifies the destination as an adapter context or an explicit address.
12594
+ * - The `to` field identifies the destination as an adapter or an explicit address.
12514
12595
  * - The `amount` field is a human-readable decimal string (for example, `'10.5'`).
12515
12596
  * - The `token` field selects the asset to move and defaults to `'USDC'`.
12516
12597
  *
12517
12598
  * @remarks
12518
- * When `to` is a `string`, the address must be valid for the destination chain. When `to` is an
12519
- * {@link AdapterContext}, the recipient is derived from the adapter's active account.
12599
+ * When `to` is a `string`, the address must be a valid address. When `to` is an
12600
+ * {@link Adapter}, the recipient is derived from the adapter's active account.
12520
12601
  *
12521
12602
  * The `token` field accepts both supported token aliases ('USDC', 'USDT', 'NATIVE') and custom token
12522
12603
  * contract addresses.
12523
12604
  *
12524
12605
  * @example
12525
12606
  * ```typescript
12526
- * // Send using a known alias
12607
+ * // Send USDC to a recipient adapter (address derived on-chain)
12527
12608
  * const params: SendParams = {
12528
- * from: { adapter: sourceAdapter, chain: sourceChain },
12529
- * to: { adapter: destAdapter, chain: destChain },
12609
+ * from: { adapter: sourceAdapter, chain: 'Ethereum' },
12610
+ * to: recipientAdapter,
12530
12611
  * amount: '10.5',
12531
12612
  * token: 'USDC'
12532
12613
  * }
12533
12614
  *
12534
12615
  * // Send using a custom token address (DAI on Ethereum)
12535
12616
  * const paramsCustomToken: SendParams = {
12536
- * from: { adapter: sourceAdapter, chain: sourceChain },
12617
+ * from: { adapter: sourceAdapter, chain: 'Ethereum' },
12537
12618
  * to: '0x1234...abcd',
12538
12619
  * amount: '100.0',
12539
12620
  * token: '0x6B175474E89094C44Da98b954EedeAC495271d0F'
@@ -12776,10 +12857,10 @@ declare class AppKit {
12776
12857
  *
12777
12858
  * @example
12778
12859
  * ```typescript
12779
- * // Send USDC to another adapter
12860
+ * // Send USDC to a recipient adapter (same chain)
12780
12861
  * const result = await kit.send({
12781
- * from: sourceAdapter,
12782
- * to: { adapter: destAdapter, chain: 'Polygon' },
12862
+ * from: { adapter: sourceAdapter, chain: 'Ethereum' },
12863
+ * to: recipientAdapter,
12783
12864
  * amount: '100.50',
12784
12865
  * token: 'USDC'
12785
12866
  * })
@@ -12790,7 +12871,7 @@ declare class AppKit {
12790
12871
  * ```typescript
12791
12872
  * // Send a custom token to an explicit address
12792
12873
  * const result = await kit.send({
12793
- * from: sourceAdapter,
12874
+ * from: { adapter: sourceAdapter, chain: 'Ethereum' },
12794
12875
  * to: '0x742d35Cc4634C0532925a3b8D1d7',
12795
12876
  * amount: '100.50',
12796
12877
  * token: '0x6B175474E89094C44Da98b954EedeAC495271d0F' // DAI on Ethereum
@@ -12802,8 +12883,8 @@ declare class AppKit {
12802
12883
  * ```typescript
12803
12884
  * // Send USDT to an explicit address
12804
12885
  * const result = await kit.send({
12805
- * from: sourceAdapter,
12806
- * to: { address: '0x742d35Cc4634C0532925a3b8D1d7', chain: 'Polygon' },
12886
+ * from: { adapter: sourceAdapter, chain: 'Ethereum' },
12887
+ * to: '0x742d35Cc4634C0532925a3b8D1d7',
12807
12888
  * amount: '50.25',
12808
12889
  * token: 'USDT'
12809
12890
  * })
@@ -12827,8 +12908,8 @@ declare class AppKit {
12827
12908
  * @example
12828
12909
  * ```typescript
12829
12910
  * const estimate = await kit.estimateSend({
12830
- * from: sourceAdapter,
12831
- * to: { adapter: destAdapter, chain: 'Polygon' },
12911
+ * from: { adapter: sourceAdapter, chain: 'Ethereum' },
12912
+ * to: recipientAdapter,
12832
12913
  * amount: '100.50',
12833
12914
  * token: 'USDC'
12834
12915
  * })
@@ -12839,8 +12920,8 @@ declare class AppKit {
12839
12920
  * @example
12840
12921
  * ```typescript
12841
12922
  * const estimate = await kit.estimateSend({
12842
- * from: sourceAdapter,
12843
- * to: { adapter: destAdapter, chain: 'Polygon' },
12923
+ * from: { adapter: sourceAdapter, chain: 'Ethereum' },
12924
+ * to: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
12844
12925
  * amount: '50.0',
12845
12926
  * token: 'USDT'
12846
12927
  * })