@owney/sdk 0.7.21-beta.4 → 0.7.21-beta.6
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/README.md +7 -7
- package/dist/index.cjs +521 -393
- package/dist/index.d.cts +17 -22
- package/dist/index.d.ts +17 -22
- package/dist/index.js +509 -377
- package/package.json +1 -1
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
|
-
*
|
|
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
|
|
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
|
-
*
|
|
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,15 @@ declare class OwneySDK {
|
|
|
728
719
|
*/
|
|
729
720
|
ensureAutoSelectProtocols(asset: "USDC" | "WETH", agentId?: AgentId): Promise<boolean>;
|
|
730
721
|
/**
|
|
731
|
-
*
|
|
732
|
-
*
|
|
733
|
-
*
|
|
734
|
-
*
|
|
735
|
-
*
|
|
722
|
+
* User-paid approval of Permit2 on the selected token for the active chain.
|
|
723
|
+
* Approves exactly the pending deposit amount. Another approval is required
|
|
724
|
+
* for a later deposit once this allowance has been consumed. Resolves after
|
|
725
|
+
* one confirmation so the subsequent deposit attempt sees the new allowance.
|
|
726
|
+
*
|
|
727
|
+
* @param requiredAmount Raw base-unit amount the pending deposit must cover.
|
|
736
728
|
* @returns the approval transaction hash.
|
|
737
729
|
*/
|
|
738
|
-
approvePermit2(asset?:
|
|
730
|
+
approvePermit2(asset?: OwneySupportedTokens, requiredAmount?: bigint): Promise<`0x${string}`>;
|
|
739
731
|
/**
|
|
740
732
|
* Get the agent's average APY performance over a time period. Does not require a wallet connection.
|
|
741
733
|
* @param options - Contains agentId (optional) and days ("7D", "14D", or "30D")
|
|
@@ -806,6 +798,8 @@ declare class YieldseekerAgent implements IAgent {
|
|
|
806
798
|
private readonly agentContexts;
|
|
807
799
|
private readonly users;
|
|
808
800
|
private readonly pendingAgents;
|
|
801
|
+
private readonly yieldOptions;
|
|
802
|
+
private readonly pendingYieldOptions;
|
|
809
803
|
constructor(owneyApiKey: string, options?: YieldseekerAgentOptions);
|
|
810
804
|
disconnect(): Promise<void>;
|
|
811
805
|
activateAgent(state: ConnectionState, chainId: number, asset?: OwneySupportedTokens): Promise<void>;
|
|
@@ -817,6 +811,7 @@ declare class YieldseekerAgent implements IAgent {
|
|
|
817
811
|
getHistory(state: ConnectionState, chainId: number, options?: HistoryFilters): Promise<OwneyAgentHistory>;
|
|
818
812
|
getUserProfile(state: ConnectionState, chainId: number): Promise<AgentUserProfile>;
|
|
819
813
|
getAgentApy(days: DailyApyDays, options?: AgentApyOptions): Promise<AgentApy>;
|
|
814
|
+
private loadYieldOptions;
|
|
820
815
|
private userKey;
|
|
821
816
|
private contextKey;
|
|
822
817
|
private resolveUser;
|
|
@@ -826,7 +821,7 @@ declare class YieldseekerAgent implements IAgent {
|
|
|
826
821
|
private resolveAgent;
|
|
827
822
|
private loadPortfolio;
|
|
828
823
|
private loadPortfolioContext;
|
|
829
|
-
private
|
|
824
|
+
private deployAgent;
|
|
830
825
|
private refreshSnapshotAfterMovement;
|
|
831
826
|
private agentPath;
|
|
832
827
|
private walletRequest;
|
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
|
-
*
|
|
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
|
|
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
|
-
*
|
|
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,15 @@ declare class OwneySDK {
|
|
|
728
719
|
*/
|
|
729
720
|
ensureAutoSelectProtocols(asset: "USDC" | "WETH", agentId?: AgentId): Promise<boolean>;
|
|
730
721
|
/**
|
|
731
|
-
*
|
|
732
|
-
*
|
|
733
|
-
*
|
|
734
|
-
*
|
|
735
|
-
*
|
|
722
|
+
* User-paid approval of Permit2 on the selected token for the active chain.
|
|
723
|
+
* Approves exactly the pending deposit amount. Another approval is required
|
|
724
|
+
* for a later deposit once this allowance has been consumed. Resolves after
|
|
725
|
+
* one confirmation so the subsequent deposit attempt sees the new allowance.
|
|
726
|
+
*
|
|
727
|
+
* @param requiredAmount Raw base-unit amount the pending deposit must cover.
|
|
736
728
|
* @returns the approval transaction hash.
|
|
737
729
|
*/
|
|
738
|
-
approvePermit2(asset?:
|
|
730
|
+
approvePermit2(asset?: OwneySupportedTokens, requiredAmount?: bigint): Promise<`0x${string}`>;
|
|
739
731
|
/**
|
|
740
732
|
* Get the agent's average APY performance over a time period. Does not require a wallet connection.
|
|
741
733
|
* @param options - Contains agentId (optional) and days ("7D", "14D", or "30D")
|
|
@@ -806,6 +798,8 @@ declare class YieldseekerAgent implements IAgent {
|
|
|
806
798
|
private readonly agentContexts;
|
|
807
799
|
private readonly users;
|
|
808
800
|
private readonly pendingAgents;
|
|
801
|
+
private readonly yieldOptions;
|
|
802
|
+
private readonly pendingYieldOptions;
|
|
809
803
|
constructor(owneyApiKey: string, options?: YieldseekerAgentOptions);
|
|
810
804
|
disconnect(): Promise<void>;
|
|
811
805
|
activateAgent(state: ConnectionState, chainId: number, asset?: OwneySupportedTokens): Promise<void>;
|
|
@@ -817,6 +811,7 @@ declare class YieldseekerAgent implements IAgent {
|
|
|
817
811
|
getHistory(state: ConnectionState, chainId: number, options?: HistoryFilters): Promise<OwneyAgentHistory>;
|
|
818
812
|
getUserProfile(state: ConnectionState, chainId: number): Promise<AgentUserProfile>;
|
|
819
813
|
getAgentApy(days: DailyApyDays, options?: AgentApyOptions): Promise<AgentApy>;
|
|
814
|
+
private loadYieldOptions;
|
|
820
815
|
private userKey;
|
|
821
816
|
private contextKey;
|
|
822
817
|
private resolveUser;
|
|
@@ -826,7 +821,7 @@ declare class YieldseekerAgent implements IAgent {
|
|
|
826
821
|
private resolveAgent;
|
|
827
822
|
private loadPortfolio;
|
|
828
823
|
private loadPortfolioContext;
|
|
829
|
-
private
|
|
824
|
+
private deployAgent;
|
|
830
825
|
private refreshSnapshotAfterMovement;
|
|
831
826
|
private agentPath;
|
|
832
827
|
private walletRequest;
|