@owney/sdk 0.7.21-beta.3 → 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;
@@ -601,10 +591,9 @@ declare class OwneySDK {
601
591
  * Serializing costs no real wall-clock: the user can only approve one prompt
602
592
  * at a time anyway.
603
593
  *
604
- * Every agent is attempted even if an earlier one fails, so one declined
605
- * signature can't deny the remaining agents their turn. Once all agents have
606
- * had a chance, a partial failure identifies the agents that still need a
607
- * retry; if none activated, the original provider error is preserved.
594
+ * Stop at the first failure so a canceled sign-in does not open another
595
+ * agent's wallet prompt. Report any earlier successes for diagnostics; the
596
+ * app discards the session when the complete sign-in does not succeed.
608
597
  */
609
598
  private activateAgentsInTurn;
610
599
  /**
@@ -615,7 +604,8 @@ declare class OwneySDK {
615
604
  * @param options.asset - Asset symbol to deposit (e.g. "USDC")
616
605
  * @param options.depositCallback - Callback that performs the token transfer and returns a tx hash.
617
606
  * When agentId is omitted, this callback is invoked once per eligible agent with that agent's
618
- * 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.
619
609
  * @param options.agentId - Optional explicit target. Otherwise split equally,
620
610
  * or fund remaining agents when a recovery deposit cannot meet every minimum.
621
611
  * @returns {OwneyDepositResult} for a single agent, or {OwneyMultiDepositResult} with per-agent results
@@ -627,7 +617,7 @@ declare class OwneySDK {
627
617
  *
628
618
  * 1. Missing Permit2 allowance: when the app did not supply its own
629
619
  * callback and the attempt fails with `PERMIT2_APPROVAL_REQUIRED` on a
630
- * 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
631
621
  * the one-time (user-paid) Permit2 approval via `approvePermit2()` and
632
622
  * retry the SAME sponsored attempt once. Bounded to one approval attempt
633
623
  * per call so a wallet/agent that keeps reporting the allowance as
@@ -729,14 +719,14 @@ declare class OwneySDK {
729
719
  */
730
720
  ensureAutoSelectProtocols(asset: "USDC" | "WETH", agentId?: AgentId): Promise<boolean>;
731
721
  /**
732
- * One-time, user-paid approval of Permit2 on the sponsored WETH token for
733
- * 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
734
724
  * deposits; afterwards deposit() is signature-only. Resolves only after the
735
725
  * approval transaction is mined (1 confirmation), so a subsequent deposit()
736
726
  * will see the new allowance; throws if the transaction reverted.
737
727
  * @returns the approval transaction hash.
738
728
  */
739
- approvePermit2(asset?: "WETH"): Promise<`0x${string}`>;
729
+ approvePermit2(asset?: OwneySupportedTokens): Promise<`0x${string}`>;
740
730
  /**
741
731
  * Get the agent's average APY performance over a time period. Does not require a wallet connection.
742
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;
@@ -601,10 +591,9 @@ declare class OwneySDK {
601
591
  * Serializing costs no real wall-clock: the user can only approve one prompt
602
592
  * at a time anyway.
603
593
  *
604
- * Every agent is attempted even if an earlier one fails, so one declined
605
- * signature can't deny the remaining agents their turn. Once all agents have
606
- * had a chance, a partial failure identifies the agents that still need a
607
- * retry; if none activated, the original provider error is preserved.
594
+ * Stop at the first failure so a canceled sign-in does not open another
595
+ * agent's wallet prompt. Report any earlier successes for diagnostics; the
596
+ * app discards the session when the complete sign-in does not succeed.
608
597
  */
609
598
  private activateAgentsInTurn;
610
599
  /**
@@ -615,7 +604,8 @@ declare class OwneySDK {
615
604
  * @param options.asset - Asset symbol to deposit (e.g. "USDC")
616
605
  * @param options.depositCallback - Callback that performs the token transfer and returns a tx hash.
617
606
  * When agentId is omitted, this callback is invoked once per eligible agent with that agent's
618
- * 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.
619
609
  * @param options.agentId - Optional explicit target. Otherwise split equally,
620
610
  * or fund remaining agents when a recovery deposit cannot meet every minimum.
621
611
  * @returns {OwneyDepositResult} for a single agent, or {OwneyMultiDepositResult} with per-agent results
@@ -627,7 +617,7 @@ declare class OwneySDK {
627
617
  *
628
618
  * 1. Missing Permit2 allowance: when the app did not supply its own
629
619
  * callback and the attempt fails with `PERMIT2_APPROVAL_REQUIRED` on a
630
- * 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
631
621
  * the one-time (user-paid) Permit2 approval via `approvePermit2()` and
632
622
  * retry the SAME sponsored attempt once. Bounded to one approval attempt
633
623
  * per call so a wallet/agent that keeps reporting the allowance as
@@ -729,14 +719,14 @@ declare class OwneySDK {
729
719
  */
730
720
  ensureAutoSelectProtocols(asset: "USDC" | "WETH", agentId?: AgentId): Promise<boolean>;
731
721
  /**
732
- * One-time, user-paid approval of Permit2 on the sponsored WETH token for
733
- * 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
734
724
  * deposits; afterwards deposit() is signature-only. Resolves only after the
735
725
  * approval transaction is mined (1 confirmation), so a subsequent deposit()
736
726
  * will see the new allowance; throws if the transaction reverted.
737
727
  * @returns the approval transaction hash.
738
728
  */
739
- approvePermit2(asset?: "WETH"): Promise<`0x${string}`>;
729
+ approvePermit2(asset?: OwneySupportedTokens): Promise<`0x${string}`>;
740
730
  /**
741
731
  * Get the agent's average APY performance over a time period. Does not require a wallet connection.
742
732
  * @param options - Contains agentId (optional) and days ("7D", "14D", or "30D")