@owney/sdk 0.7.21-beta.4 → 0.7.21-beta.5

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/dist/index.d.cts CHANGED
@@ -532,25 +532,15 @@ declare class OwneySDK {
532
532
  private requireState;
533
533
  private requireChainId;
534
534
  private requireConnectedProvider;
535
- /**
536
- * Lazily builds (and caches) the default EIP-3009 sponsored deposit callback
537
- * used when the caller omits `depositCallback`. Wraps the connected EIP-1193
538
- * provider with viem `custom(provider)` to read token meta and sign the
539
- * `TransferWithAuthorization`, then POSTs to the sponsor API.
540
- */
535
+ /** Builds the default USDC batch callback for the connected wallet. */
541
536
  private getDefaultSponsoredCallback;
542
- /**
543
- * Lazily builds (and caches) the default Permit2 sponsored WETH deposit
544
- * callback used when the caller omits `depositCallback` for a WETH
545
- * deposit. Mirrors `getDefaultSponsoredCallback()` but signs a Permit2
546
- * `PermitTransferFrom` instead of an EIP-3009 authorization.
547
- */
537
+ /** Builds the wallet-native sponsored calls callback for compatible paymasters. */
548
538
  private getDefaultSponsoredCallsCallback;
549
539
  /**
550
540
  * Lazily builds (and caches) the default Permit2 sponsored WETH deposit
551
541
  * callback used when the caller omits `depositCallback` for a WETH deposit.
552
542
  * Mirrors `getDefaultSponsoredCallback()` but signs a Permit2
553
- * `PermitTransferFrom` instead of an EIP-3009 authorization.
543
+ * single-use batch authorization instead of an EIP-3009 authorization.
554
544
  */
555
545
  private getDefaultWethSponsoredCallback;
556
546
  private getAgent;
@@ -614,7 +604,8 @@ declare class OwneySDK {
614
604
  * @param options.asset - Asset symbol to deposit (e.g. "USDC")
615
605
  * @param options.depositCallback - Callback that performs the token transfer and returns a tx hash.
616
606
  * When agentId is omitted, this callback is invoked once per eligible agent with that agent's
617
- * split amount and smart wallet address — expect multiple wallet prompts.
607
+ * split amount and smart wallet address. Default sponsored deposits batch
608
+ * all shares into one signature; custom callbacks still run once per agent.
618
609
  * @param options.agentId - Optional explicit target. Otherwise split equally,
619
610
  * or fund remaining agents when a recovery deposit cannot meet every minimum.
620
611
  * @returns {OwneyDepositResult} for a single agent, or {OwneyMultiDepositResult} with per-agent results
@@ -626,7 +617,7 @@ declare class OwneySDK {
626
617
  *
627
618
  * 1. Missing Permit2 allowance: when the app did not supply its own
628
619
  * callback and the attempt fails with `PERMIT2_APPROVAL_REQUIRED` on a
629
- * WETH deposit, this is the wallet's first gasless WETH deposit. We send
620
+ * token deposit, this is the wallet's first Permit2 deposit for that token. We send
630
621
  * the one-time (user-paid) Permit2 approval via `approvePermit2()` and
631
622
  * retry the SAME sponsored attempt once. Bounded to one approval attempt
632
623
  * per call so a wallet/agent that keeps reporting the allowance as
@@ -728,14 +719,14 @@ declare class OwneySDK {
728
719
  */
729
720
  ensureAutoSelectProtocols(asset: "USDC" | "WETH", agentId?: AgentId): Promise<boolean>;
730
721
  /**
731
- * One-time, user-paid approval of Permit2 on the sponsored WETH token for
732
- * the active chain. Required once per wallet per chain before gasless WETH
722
+ * One-time, user-paid approval of Permit2 on the selected token for
723
+ * the active chain. Required once per wallet, token and chain before sponsored
733
724
  * deposits; afterwards deposit() is signature-only. Resolves only after the
734
725
  * approval transaction is mined (1 confirmation), so a subsequent deposit()
735
726
  * will see the new allowance; throws if the transaction reverted.
736
727
  * @returns the approval transaction hash.
737
728
  */
738
- approvePermit2(asset?: "WETH"): Promise<`0x${string}`>;
729
+ approvePermit2(asset?: OwneySupportedTokens): Promise<`0x${string}`>;
739
730
  /**
740
731
  * Get the agent's average APY performance over a time period. Does not require a wallet connection.
741
732
  * @param options - Contains agentId (optional) and days ("7D", "14D", or "30D")
package/dist/index.d.ts CHANGED
@@ -532,25 +532,15 @@ declare class OwneySDK {
532
532
  private requireState;
533
533
  private requireChainId;
534
534
  private requireConnectedProvider;
535
- /**
536
- * Lazily builds (and caches) the default EIP-3009 sponsored deposit callback
537
- * used when the caller omits `depositCallback`. Wraps the connected EIP-1193
538
- * provider with viem `custom(provider)` to read token meta and sign the
539
- * `TransferWithAuthorization`, then POSTs to the sponsor API.
540
- */
535
+ /** Builds the default USDC batch callback for the connected wallet. */
541
536
  private getDefaultSponsoredCallback;
542
- /**
543
- * Lazily builds (and caches) the default Permit2 sponsored WETH deposit
544
- * callback used when the caller omits `depositCallback` for a WETH
545
- * deposit. Mirrors `getDefaultSponsoredCallback()` but signs a Permit2
546
- * `PermitTransferFrom` instead of an EIP-3009 authorization.
547
- */
537
+ /** Builds the wallet-native sponsored calls callback for compatible paymasters. */
548
538
  private getDefaultSponsoredCallsCallback;
549
539
  /**
550
540
  * Lazily builds (and caches) the default Permit2 sponsored WETH deposit
551
541
  * callback used when the caller omits `depositCallback` for a WETH deposit.
552
542
  * Mirrors `getDefaultSponsoredCallback()` but signs a Permit2
553
- * `PermitTransferFrom` instead of an EIP-3009 authorization.
543
+ * single-use batch authorization instead of an EIP-3009 authorization.
554
544
  */
555
545
  private getDefaultWethSponsoredCallback;
556
546
  private getAgent;
@@ -614,7 +604,8 @@ declare class OwneySDK {
614
604
  * @param options.asset - Asset symbol to deposit (e.g. "USDC")
615
605
  * @param options.depositCallback - Callback that performs the token transfer and returns a tx hash.
616
606
  * When agentId is omitted, this callback is invoked once per eligible agent with that agent's
617
- * split amount and smart wallet address — expect multiple wallet prompts.
607
+ * split amount and smart wallet address. Default sponsored deposits batch
608
+ * all shares into one signature; custom callbacks still run once per agent.
618
609
  * @param options.agentId - Optional explicit target. Otherwise split equally,
619
610
  * or fund remaining agents when a recovery deposit cannot meet every minimum.
620
611
  * @returns {OwneyDepositResult} for a single agent, or {OwneyMultiDepositResult} with per-agent results
@@ -626,7 +617,7 @@ declare class OwneySDK {
626
617
  *
627
618
  * 1. Missing Permit2 allowance: when the app did not supply its own
628
619
  * callback and the attempt fails with `PERMIT2_APPROVAL_REQUIRED` on a
629
- * WETH deposit, this is the wallet's first gasless WETH deposit. We send
620
+ * token deposit, this is the wallet's first Permit2 deposit for that token. We send
630
621
  * the one-time (user-paid) Permit2 approval via `approvePermit2()` and
631
622
  * retry the SAME sponsored attempt once. Bounded to one approval attempt
632
623
  * per call so a wallet/agent that keeps reporting the allowance as
@@ -728,14 +719,14 @@ declare class OwneySDK {
728
719
  */
729
720
  ensureAutoSelectProtocols(asset: "USDC" | "WETH", agentId?: AgentId): Promise<boolean>;
730
721
  /**
731
- * One-time, user-paid approval of Permit2 on the sponsored WETH token for
732
- * the active chain. Required once per wallet per chain before gasless WETH
722
+ * One-time, user-paid approval of Permit2 on the selected token for
723
+ * the active chain. Required once per wallet, token and chain before sponsored
733
724
  * deposits; afterwards deposit() is signature-only. Resolves only after the
734
725
  * approval transaction is mined (1 confirmation), so a subsequent deposit()
735
726
  * will see the new allowance; throws if the transaction reverted.
736
727
  * @returns the approval transaction hash.
737
728
  */
738
- approvePermit2(asset?: "WETH"): Promise<`0x${string}`>;
729
+ approvePermit2(asset?: OwneySupportedTokens): Promise<`0x${string}`>;
739
730
  /**
740
731
  * Get the agent's average APY performance over a time period. Does not require a wallet connection.
741
732
  * @param options - Contains agentId (optional) and days ("7D", "14D", or "30D")