@owney/sdk 0.7.25-beta.18 → 0.7.25-beta.20
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.cjs +983 -410
- package/dist/index.d.cts +33 -20
- package/dist/index.d.ts +33 -20
- package/dist/index.js +892 -317
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -169,9 +169,9 @@ interface IAgent {
|
|
|
169
169
|
*/
|
|
170
170
|
tokenSymbol?: string): Promise<AccountAgentApy>;
|
|
171
171
|
/**
|
|
172
|
-
* Daily cumulative
|
|
173
|
-
*
|
|
174
|
-
*
|
|
172
|
+
* Daily cumulative earnings in token units, scoped to a chain/asset, using
|
|
173
|
+
* the provider's earnings basis. Include an opening snapshot when available
|
|
174
|
+
* so the "recent earnings" subline can difference the endpoints. (ROUT-452)
|
|
175
175
|
*/
|
|
176
176
|
getDailyEarnings?(state: ConnectionState, chainId: number, days: LookbackDays, tokenSymbol?: string): Promise<AccountDailyEarnings>;
|
|
177
177
|
getHistory(state: ConnectionState, chainId: number, options?: HistoryFilters): Promise<OwneyAgentHistory>;
|
|
@@ -344,6 +344,10 @@ interface FundingEvidence {
|
|
|
344
344
|
agentWallet?: string;
|
|
345
345
|
intendedAmount: string;
|
|
346
346
|
confirmedAmount?: string;
|
|
347
|
+
/** Receipt delivery and fulfillment of a typed requested amount are separate facts. */
|
|
348
|
+
amountCompletion?: "complete" | "shortfall";
|
|
349
|
+
/** Verified difference between the typed request and the actual owner payout. */
|
|
350
|
+
shortfallAmount?: string;
|
|
347
351
|
txHash?: string;
|
|
348
352
|
/** Persisted before a sponsored EOA operation is sent. */
|
|
349
353
|
userOpHash?: string;
|
|
@@ -405,9 +409,10 @@ interface AgentWithdrawResult {
|
|
|
405
409
|
evidence?: FundingEvidence;
|
|
406
410
|
txHash?: string;
|
|
407
411
|
type: "full" | "partial";
|
|
408
|
-
/** Owner payout
|
|
412
|
+
/** Owner payout or clearing all MAX positions still needs verification. */
|
|
409
413
|
completion?: "unverified";
|
|
410
|
-
/**
|
|
414
|
+
/** Confirmed smallest-unit amount; "0" when no owner payout is verified.
|
|
415
|
+
* Legacy providers may return a sentinel such as "all" for a full request. */
|
|
411
416
|
amount: string;
|
|
412
417
|
/** Yieldseeker typed withdrawal fulfilled after an exactly verified fee
|
|
413
418
|
* deduction. Amount remains the confirmed net owner payout, and the gross
|
|
@@ -420,8 +425,9 @@ interface AgentWithdrawResult {
|
|
|
420
425
|
interface OwneyWithdrawResult {
|
|
421
426
|
agentResult: Record<AgentId, AgentWithdrawResult>;
|
|
422
427
|
/**
|
|
423
|
-
* Sum of
|
|
424
|
-
*
|
|
428
|
+
* Sum of confirmed smallest-unit amounts; null while any returned leg's
|
|
429
|
+
* payout is not yet known, including typed requests accepted asynchronously.
|
|
430
|
+
* Evidence-less custom adapters retain their confirmed-amount contract.
|
|
425
431
|
*/
|
|
426
432
|
totalWithdrawn: string | null;
|
|
427
433
|
}
|
|
@@ -658,15 +664,15 @@ interface AgentApy {
|
|
|
658
664
|
interface OwneyAgentApy {
|
|
659
665
|
agentApy: Record<AgentId, AgentApy>;
|
|
660
666
|
}
|
|
661
|
-
/** One day's cumulative
|
|
667
|
+
/** One day's cumulative earnings for a single asset. */
|
|
662
668
|
interface DailyEarningsPoint {
|
|
663
669
|
/** ISO date string for the day, e.g. "2026-09-01". */
|
|
664
670
|
date: string;
|
|
665
671
|
/**
|
|
666
|
-
*
|
|
667
|
-
*
|
|
668
|
-
*
|
|
669
|
-
*
|
|
672
|
+
* Cumulative earnings in the asset's own units, using the provider's earnings
|
|
673
|
+
* basis. A provider may return lifetime totals or a running window total;
|
|
674
|
+
* difference the last and opening points to measure earnings over the window.
|
|
675
|
+
* Aggregate series normalize each component's opening value before summing.
|
|
670
676
|
*/
|
|
671
677
|
amount: number;
|
|
672
678
|
}
|
|
@@ -675,8 +681,9 @@ interface AssetDailyEarnings {
|
|
|
675
681
|
/** Asset symbol, e.g. "USDC" / "WETH". */
|
|
676
682
|
asset: string;
|
|
677
683
|
/**
|
|
678
|
-
* Ascending by date
|
|
679
|
-
*
|
|
684
|
+
* Ascending by date, including an opening snapshot before the requested
|
|
685
|
+
* window when available. Provider gaps remain absent; aggregates carry the
|
|
686
|
+
* most recent cumulative value across dates reported by other providers.
|
|
680
687
|
*/
|
|
681
688
|
points: DailyEarningsPoint[];
|
|
682
689
|
}
|
|
@@ -703,6 +710,8 @@ declare class OwneySDK {
|
|
|
703
710
|
*/
|
|
704
711
|
private disabledAgents;
|
|
705
712
|
private state;
|
|
713
|
+
private connectionRevision;
|
|
714
|
+
private disconnectingAgents;
|
|
706
715
|
private apiKey;
|
|
707
716
|
private orgAgentConfig;
|
|
708
717
|
private orgAgentConfigPromise;
|
|
@@ -720,6 +729,7 @@ declare class OwneySDK {
|
|
|
720
729
|
private readonly recoveredFundingReads;
|
|
721
730
|
private fundingBalanceChecks;
|
|
722
731
|
private readonly activationChecks;
|
|
732
|
+
private readonly withdrawalSubmissions;
|
|
723
733
|
private readAgent;
|
|
724
734
|
private initializingAgentsPromise;
|
|
725
735
|
constructor(config: OwneySDKConfig);
|
|
@@ -734,6 +744,8 @@ declare class OwneySDK {
|
|
|
734
744
|
* After calling this, `connect()` must be called again before using agent methods.
|
|
735
745
|
*/
|
|
736
746
|
disconnect(): Promise<void>;
|
|
747
|
+
private clearConnectionState;
|
|
748
|
+
private disconnectAgents;
|
|
737
749
|
private isAgentDisabled;
|
|
738
750
|
/**
|
|
739
751
|
* Check if the SDK has an active connection state.
|
|
@@ -882,6 +894,7 @@ declare class OwneySDK {
|
|
|
882
894
|
inspectFunding(evidence: FundingEvidence, direction: "deposit" | "withdraw", options?: {
|
|
883
895
|
balanceRefreshUntil?: number;
|
|
884
896
|
refreshBalance?: boolean;
|
|
897
|
+
requireAmountMatch?: boolean;
|
|
885
898
|
}): Promise<FundingEvidence>;
|
|
886
899
|
/** Resolve a saved sponsored-withdrawal ID without opening a wallet prompt. */
|
|
887
900
|
resolveSponsoredWithdrawalEvidence(evidence: FundingEvidence, options?: {
|
|
@@ -954,10 +967,8 @@ declare class OwneySDK {
|
|
|
954
967
|
* @returns {AccountAgentApy} for a single agent, or {OwneyAccountApy} with totalApy and per-agent breakdown
|
|
955
968
|
*/
|
|
956
969
|
/**
|
|
957
|
-
* Daily cumulative
|
|
958
|
-
* "recent earnings" subline.
|
|
959
|
-
* `lifetime + unrealized + current x 0.9`, so the figure reconciles with the
|
|
960
|
-
* balance headline rather than reading ~11% high. (ROUT-452)
|
|
970
|
+
* Daily cumulative earnings in the selected asset's units, backing the
|
|
971
|
+
* "recent earnings" subline. Each adapter uses its provider's earnings basis.
|
|
961
972
|
*
|
|
962
973
|
* Unlike getAccountApy this does NOT blend across agents: earnings are
|
|
963
974
|
* summed, not weighted, and an agent that fails to report must not silently
|
|
@@ -1069,7 +1080,7 @@ type YieldseekerAgentOptions = {
|
|
|
1069
1080
|
/** Dedicated read transport; Base is used for receipt polling. */
|
|
1070
1081
|
rpcUrls?: RpcUrlsConfig;
|
|
1071
1082
|
/** Test seam for the wallet-submission/receipt boundary. */
|
|
1072
|
-
transactionExecutor?: (state: ConnectionState, chainId: number, transaction: YieldseekerTransaction) => Promise<Hex>;
|
|
1083
|
+
transactionExecutor?: (state: ConnectionState, chainId: number, transaction: YieldseekerTransaction, onReceipt?: (receipt: viem.TransactionReceipt) => void) => Promise<Hex>;
|
|
1073
1084
|
/** Test seam for transactions submitted outside transactionExecutor. */
|
|
1074
1085
|
unwindReceiptWaiter?: (state: ConnectionState, chainId: number, transactionHash: Hex) => Promise<void>;
|
|
1075
1086
|
};
|
|
@@ -1096,6 +1107,7 @@ declare class YieldseekerAgent implements IAgent {
|
|
|
1096
1107
|
private readonly routingApiBaseUrl?;
|
|
1097
1108
|
private receiptClient?;
|
|
1098
1109
|
private readonly withdrawalVersionCache;
|
|
1110
|
+
private readonly pendingUpgrades;
|
|
1099
1111
|
private readonly transactionExecutor?;
|
|
1100
1112
|
private readonly unwindReceiptWaiter?;
|
|
1101
1113
|
private readonly agentContexts;
|
|
@@ -1146,6 +1158,7 @@ declare class YieldseekerAgent implements IAgent {
|
|
|
1146
1158
|
hasExistingDepositFunds(state: ConnectionState, chainId: number, asset: OwneySupportedTokens): Promise<true | undefined>;
|
|
1147
1159
|
getEarnings(state: ConnectionState, chainId: number): Promise<AgentEarnings>;
|
|
1148
1160
|
getAccountApy(state: ConnectionState, chainId: number, days: DailyApyDays, tokenSymbol?: string): Promise<AccountAgentApy>;
|
|
1161
|
+
getDailyEarnings(state: ConnectionState, chainId: number, days: LookbackDays, tokenSymbol?: string): Promise<AccountDailyEarnings>;
|
|
1149
1162
|
getHistory(state: ConnectionState, chainId: number, options?: HistoryFilters): Promise<OwneyAgentHistory>;
|
|
1150
1163
|
getUserProfile(state: ConnectionState, chainId: number): Promise<AgentUserProfile>;
|
|
1151
1164
|
getAgentApy(days: DailyApyDays, options?: AgentApyOptions): Promise<AgentApy>;
|
|
@@ -1193,7 +1206,7 @@ declare class YieldseekerAgent implements IAgent {
|
|
|
1193
1206
|
private invalidResponse;
|
|
1194
1207
|
}
|
|
1195
1208
|
|
|
1196
|
-
type OwneyErrorCode = "NOT_CONNECTED" | "NO_ACTIVE_CHAIN" | "WALLET_NO_ACCOUNTS" | "WALLET_ADDRESS_REQUIRED" | "WALLET_NOT_DEPLOYED" | "AGENT_NOT_FOUND" | "AGENT_CHAIN_INCOMPATIBLE" | "AGENT_EMPTY_LIST" | "AGENT_DISABLED" | "AGENT_ACTIVATION_PARTIAL_FAILURE" | "CHAIN_UNSUPPORTED" | "CHAIN_NO_COMPATIBLE_AGENTS" | "CHAIN_MISMATCH" | "ASSET_UNSUPPORTED" | "ASSET_NO_COMPATIBLE_AGENTS" | "DEPOSIT_BALANCE_UNAVAILABLE" | "DEPOSIT_PARTIAL_FAILURE" | "DEPOSIT_IN_PROGRESS" | "DEPOSIT_AMOUNT_BELOW_MINIMUM" | "DEPOSIT_CALLBACK_REQUIRED" | "DEPOSIT_CALLBACK_INVALID" | "DEPOSIT_NO_PERMITTED_TOKENS" | "DEPOSIT_INSUFFICIENT_BALANCE" | "WITHDRAW_NO_PERMITTED_TOKENS" | "WITHDRAW_BALANCE_UNAVAILABLE" | "WITHDRAW_INSUFFICIENT_BALANCE" | "WITHDRAW_ALL_FAILED" | "WITHDRAW_PARTIAL_FAILURE" | "WITHDRAW_FAILED" | "AGENT_RATE_LIMITED" | "API_ROUTING_ERROR" | "API_ROUTING_FAILED" | "API_NO_AGENTS" | "AGENT_API_ERROR" | "AGENT_AUTH_FAILED" | "AGENT_INVALID_RESPONSE" | "AGENT_TIMEOUT" | "AGENT_TRANSACTION_REVERTED" | "SPONSOR_REQUEST_FAILED" | "PERMIT2_APPROVAL_REQUIRED" | "SPONSORED_CALLS_UNSUPPORTED" | "SPONSORED_CALLS_NO_ID" | "SPONSORED_CALLS_NO_RECEIPT" | "BALANCE_ALL_FAILED" | "EARNINGS_ALL_FAILED" | "ALLOCATION_ALL_FAILED" | "VALIDATION_INVALID_DAYS";
|
|
1209
|
+
type OwneyErrorCode = "NOT_CONNECTED" | "NO_ACTIVE_CHAIN" | "WALLET_NO_ACCOUNTS" | "WALLET_ADDRESS_REQUIRED" | "WALLET_NOT_DEPLOYED" | "AGENT_NOT_FOUND" | "AGENT_CHAIN_INCOMPATIBLE" | "AGENT_EMPTY_LIST" | "AGENT_DISABLED" | "AGENT_ACTIVATION_PARTIAL_FAILURE" | "CHAIN_UNSUPPORTED" | "CHAIN_NO_COMPATIBLE_AGENTS" | "CHAIN_MISMATCH" | "ASSET_UNSUPPORTED" | "ASSET_NO_COMPATIBLE_AGENTS" | "DEPOSIT_BALANCE_UNAVAILABLE" | "DEPOSIT_PARTIAL_FAILURE" | "DEPOSIT_IN_PROGRESS" | "DEPOSIT_AMOUNT_BELOW_MINIMUM" | "DEPOSIT_INVALID_AMOUNT" | "DEPOSIT_CALLBACK_REQUIRED" | "DEPOSIT_CALLBACK_INVALID" | "DEPOSIT_NO_PERMITTED_TOKENS" | "DEPOSIT_INSUFFICIENT_BALANCE" | "WITHDRAW_IN_PROGRESS" | "WITHDRAW_NO_PERMITTED_TOKENS" | "WITHDRAW_BALANCE_UNAVAILABLE" | "WITHDRAW_INSUFFICIENT_BALANCE" | "WITHDRAW_ALL_FAILED" | "WITHDRAW_UNCONFIRMED" | "WITHDRAW_PARTIAL_FAILURE" | "WITHDRAW_FAILED" | "WITHDRAW_INVALID_AMOUNT" | "AGENT_RATE_LIMITED" | "API_ROUTING_ERROR" | "API_ROUTING_FAILED" | "API_NO_AGENTS" | "AGENT_API_ERROR" | "AGENT_AUTH_FAILED" | "AGENT_INVALID_RESPONSE" | "AGENT_TIMEOUT" | "AGENT_TRANSACTION_REVERTED" | "SPONSOR_REQUEST_FAILED" | "PERMIT2_APPROVAL_REQUIRED" | "SPONSORED_CALLS_UNSUPPORTED" | "SPONSORED_CALLS_NO_ID" | "SPONSORED_CALLS_NO_RECEIPT" | "BALANCE_ALL_FAILED" | "EARNINGS_ALL_FAILED" | "ALLOCATION_ALL_FAILED" | "VALIDATION_INVALID_DAYS";
|
|
1197
1210
|
declare class OwneyError extends Error {
|
|
1198
1211
|
readonly code: OwneyErrorCode;
|
|
1199
1212
|
readonly details?: Record<string, unknown>;
|
package/dist/index.d.ts
CHANGED
|
@@ -169,9 +169,9 @@ interface IAgent {
|
|
|
169
169
|
*/
|
|
170
170
|
tokenSymbol?: string): Promise<AccountAgentApy>;
|
|
171
171
|
/**
|
|
172
|
-
* Daily cumulative
|
|
173
|
-
*
|
|
174
|
-
*
|
|
172
|
+
* Daily cumulative earnings in token units, scoped to a chain/asset, using
|
|
173
|
+
* the provider's earnings basis. Include an opening snapshot when available
|
|
174
|
+
* so the "recent earnings" subline can difference the endpoints. (ROUT-452)
|
|
175
175
|
*/
|
|
176
176
|
getDailyEarnings?(state: ConnectionState, chainId: number, days: LookbackDays, tokenSymbol?: string): Promise<AccountDailyEarnings>;
|
|
177
177
|
getHistory(state: ConnectionState, chainId: number, options?: HistoryFilters): Promise<OwneyAgentHistory>;
|
|
@@ -344,6 +344,10 @@ interface FundingEvidence {
|
|
|
344
344
|
agentWallet?: string;
|
|
345
345
|
intendedAmount: string;
|
|
346
346
|
confirmedAmount?: string;
|
|
347
|
+
/** Receipt delivery and fulfillment of a typed requested amount are separate facts. */
|
|
348
|
+
amountCompletion?: "complete" | "shortfall";
|
|
349
|
+
/** Verified difference between the typed request and the actual owner payout. */
|
|
350
|
+
shortfallAmount?: string;
|
|
347
351
|
txHash?: string;
|
|
348
352
|
/** Persisted before a sponsored EOA operation is sent. */
|
|
349
353
|
userOpHash?: string;
|
|
@@ -405,9 +409,10 @@ interface AgentWithdrawResult {
|
|
|
405
409
|
evidence?: FundingEvidence;
|
|
406
410
|
txHash?: string;
|
|
407
411
|
type: "full" | "partial";
|
|
408
|
-
/** Owner payout
|
|
412
|
+
/** Owner payout or clearing all MAX positions still needs verification. */
|
|
409
413
|
completion?: "unverified";
|
|
410
|
-
/**
|
|
414
|
+
/** Confirmed smallest-unit amount; "0" when no owner payout is verified.
|
|
415
|
+
* Legacy providers may return a sentinel such as "all" for a full request. */
|
|
411
416
|
amount: string;
|
|
412
417
|
/** Yieldseeker typed withdrawal fulfilled after an exactly verified fee
|
|
413
418
|
* deduction. Amount remains the confirmed net owner payout, and the gross
|
|
@@ -420,8 +425,9 @@ interface AgentWithdrawResult {
|
|
|
420
425
|
interface OwneyWithdrawResult {
|
|
421
426
|
agentResult: Record<AgentId, AgentWithdrawResult>;
|
|
422
427
|
/**
|
|
423
|
-
* Sum of
|
|
424
|
-
*
|
|
428
|
+
* Sum of confirmed smallest-unit amounts; null while any returned leg's
|
|
429
|
+
* payout is not yet known, including typed requests accepted asynchronously.
|
|
430
|
+
* Evidence-less custom adapters retain their confirmed-amount contract.
|
|
425
431
|
*/
|
|
426
432
|
totalWithdrawn: string | null;
|
|
427
433
|
}
|
|
@@ -658,15 +664,15 @@ interface AgentApy {
|
|
|
658
664
|
interface OwneyAgentApy {
|
|
659
665
|
agentApy: Record<AgentId, AgentApy>;
|
|
660
666
|
}
|
|
661
|
-
/** One day's cumulative
|
|
667
|
+
/** One day's cumulative earnings for a single asset. */
|
|
662
668
|
interface DailyEarningsPoint {
|
|
663
669
|
/** ISO date string for the day, e.g. "2026-09-01". */
|
|
664
670
|
date: string;
|
|
665
671
|
/**
|
|
666
|
-
*
|
|
667
|
-
*
|
|
668
|
-
*
|
|
669
|
-
*
|
|
672
|
+
* Cumulative earnings in the asset's own units, using the provider's earnings
|
|
673
|
+
* basis. A provider may return lifetime totals or a running window total;
|
|
674
|
+
* difference the last and opening points to measure earnings over the window.
|
|
675
|
+
* Aggregate series normalize each component's opening value before summing.
|
|
670
676
|
*/
|
|
671
677
|
amount: number;
|
|
672
678
|
}
|
|
@@ -675,8 +681,9 @@ interface AssetDailyEarnings {
|
|
|
675
681
|
/** Asset symbol, e.g. "USDC" / "WETH". */
|
|
676
682
|
asset: string;
|
|
677
683
|
/**
|
|
678
|
-
* Ascending by date
|
|
679
|
-
*
|
|
684
|
+
* Ascending by date, including an opening snapshot before the requested
|
|
685
|
+
* window when available. Provider gaps remain absent; aggregates carry the
|
|
686
|
+
* most recent cumulative value across dates reported by other providers.
|
|
680
687
|
*/
|
|
681
688
|
points: DailyEarningsPoint[];
|
|
682
689
|
}
|
|
@@ -703,6 +710,8 @@ declare class OwneySDK {
|
|
|
703
710
|
*/
|
|
704
711
|
private disabledAgents;
|
|
705
712
|
private state;
|
|
713
|
+
private connectionRevision;
|
|
714
|
+
private disconnectingAgents;
|
|
706
715
|
private apiKey;
|
|
707
716
|
private orgAgentConfig;
|
|
708
717
|
private orgAgentConfigPromise;
|
|
@@ -720,6 +729,7 @@ declare class OwneySDK {
|
|
|
720
729
|
private readonly recoveredFundingReads;
|
|
721
730
|
private fundingBalanceChecks;
|
|
722
731
|
private readonly activationChecks;
|
|
732
|
+
private readonly withdrawalSubmissions;
|
|
723
733
|
private readAgent;
|
|
724
734
|
private initializingAgentsPromise;
|
|
725
735
|
constructor(config: OwneySDKConfig);
|
|
@@ -734,6 +744,8 @@ declare class OwneySDK {
|
|
|
734
744
|
* After calling this, `connect()` must be called again before using agent methods.
|
|
735
745
|
*/
|
|
736
746
|
disconnect(): Promise<void>;
|
|
747
|
+
private clearConnectionState;
|
|
748
|
+
private disconnectAgents;
|
|
737
749
|
private isAgentDisabled;
|
|
738
750
|
/**
|
|
739
751
|
* Check if the SDK has an active connection state.
|
|
@@ -882,6 +894,7 @@ declare class OwneySDK {
|
|
|
882
894
|
inspectFunding(evidence: FundingEvidence, direction: "deposit" | "withdraw", options?: {
|
|
883
895
|
balanceRefreshUntil?: number;
|
|
884
896
|
refreshBalance?: boolean;
|
|
897
|
+
requireAmountMatch?: boolean;
|
|
885
898
|
}): Promise<FundingEvidence>;
|
|
886
899
|
/** Resolve a saved sponsored-withdrawal ID without opening a wallet prompt. */
|
|
887
900
|
resolveSponsoredWithdrawalEvidence(evidence: FundingEvidence, options?: {
|
|
@@ -954,10 +967,8 @@ declare class OwneySDK {
|
|
|
954
967
|
* @returns {AccountAgentApy} for a single agent, or {OwneyAccountApy} with totalApy and per-agent breakdown
|
|
955
968
|
*/
|
|
956
969
|
/**
|
|
957
|
-
* Daily cumulative
|
|
958
|
-
* "recent earnings" subline.
|
|
959
|
-
* `lifetime + unrealized + current x 0.9`, so the figure reconciles with the
|
|
960
|
-
* balance headline rather than reading ~11% high. (ROUT-452)
|
|
970
|
+
* Daily cumulative earnings in the selected asset's units, backing the
|
|
971
|
+
* "recent earnings" subline. Each adapter uses its provider's earnings basis.
|
|
961
972
|
*
|
|
962
973
|
* Unlike getAccountApy this does NOT blend across agents: earnings are
|
|
963
974
|
* summed, not weighted, and an agent that fails to report must not silently
|
|
@@ -1069,7 +1080,7 @@ type YieldseekerAgentOptions = {
|
|
|
1069
1080
|
/** Dedicated read transport; Base is used for receipt polling. */
|
|
1070
1081
|
rpcUrls?: RpcUrlsConfig;
|
|
1071
1082
|
/** Test seam for the wallet-submission/receipt boundary. */
|
|
1072
|
-
transactionExecutor?: (state: ConnectionState, chainId: number, transaction: YieldseekerTransaction) => Promise<Hex>;
|
|
1083
|
+
transactionExecutor?: (state: ConnectionState, chainId: number, transaction: YieldseekerTransaction, onReceipt?: (receipt: viem.TransactionReceipt) => void) => Promise<Hex>;
|
|
1073
1084
|
/** Test seam for transactions submitted outside transactionExecutor. */
|
|
1074
1085
|
unwindReceiptWaiter?: (state: ConnectionState, chainId: number, transactionHash: Hex) => Promise<void>;
|
|
1075
1086
|
};
|
|
@@ -1096,6 +1107,7 @@ declare class YieldseekerAgent implements IAgent {
|
|
|
1096
1107
|
private readonly routingApiBaseUrl?;
|
|
1097
1108
|
private receiptClient?;
|
|
1098
1109
|
private readonly withdrawalVersionCache;
|
|
1110
|
+
private readonly pendingUpgrades;
|
|
1099
1111
|
private readonly transactionExecutor?;
|
|
1100
1112
|
private readonly unwindReceiptWaiter?;
|
|
1101
1113
|
private readonly agentContexts;
|
|
@@ -1146,6 +1158,7 @@ declare class YieldseekerAgent implements IAgent {
|
|
|
1146
1158
|
hasExistingDepositFunds(state: ConnectionState, chainId: number, asset: OwneySupportedTokens): Promise<true | undefined>;
|
|
1147
1159
|
getEarnings(state: ConnectionState, chainId: number): Promise<AgentEarnings>;
|
|
1148
1160
|
getAccountApy(state: ConnectionState, chainId: number, days: DailyApyDays, tokenSymbol?: string): Promise<AccountAgentApy>;
|
|
1161
|
+
getDailyEarnings(state: ConnectionState, chainId: number, days: LookbackDays, tokenSymbol?: string): Promise<AccountDailyEarnings>;
|
|
1149
1162
|
getHistory(state: ConnectionState, chainId: number, options?: HistoryFilters): Promise<OwneyAgentHistory>;
|
|
1150
1163
|
getUserProfile(state: ConnectionState, chainId: number): Promise<AgentUserProfile>;
|
|
1151
1164
|
getAgentApy(days: DailyApyDays, options?: AgentApyOptions): Promise<AgentApy>;
|
|
@@ -1193,7 +1206,7 @@ declare class YieldseekerAgent implements IAgent {
|
|
|
1193
1206
|
private invalidResponse;
|
|
1194
1207
|
}
|
|
1195
1208
|
|
|
1196
|
-
type OwneyErrorCode = "NOT_CONNECTED" | "NO_ACTIVE_CHAIN" | "WALLET_NO_ACCOUNTS" | "WALLET_ADDRESS_REQUIRED" | "WALLET_NOT_DEPLOYED" | "AGENT_NOT_FOUND" | "AGENT_CHAIN_INCOMPATIBLE" | "AGENT_EMPTY_LIST" | "AGENT_DISABLED" | "AGENT_ACTIVATION_PARTIAL_FAILURE" | "CHAIN_UNSUPPORTED" | "CHAIN_NO_COMPATIBLE_AGENTS" | "CHAIN_MISMATCH" | "ASSET_UNSUPPORTED" | "ASSET_NO_COMPATIBLE_AGENTS" | "DEPOSIT_BALANCE_UNAVAILABLE" | "DEPOSIT_PARTIAL_FAILURE" | "DEPOSIT_IN_PROGRESS" | "DEPOSIT_AMOUNT_BELOW_MINIMUM" | "DEPOSIT_CALLBACK_REQUIRED" | "DEPOSIT_CALLBACK_INVALID" | "DEPOSIT_NO_PERMITTED_TOKENS" | "DEPOSIT_INSUFFICIENT_BALANCE" | "WITHDRAW_NO_PERMITTED_TOKENS" | "WITHDRAW_BALANCE_UNAVAILABLE" | "WITHDRAW_INSUFFICIENT_BALANCE" | "WITHDRAW_ALL_FAILED" | "WITHDRAW_PARTIAL_FAILURE" | "WITHDRAW_FAILED" | "AGENT_RATE_LIMITED" | "API_ROUTING_ERROR" | "API_ROUTING_FAILED" | "API_NO_AGENTS" | "AGENT_API_ERROR" | "AGENT_AUTH_FAILED" | "AGENT_INVALID_RESPONSE" | "AGENT_TIMEOUT" | "AGENT_TRANSACTION_REVERTED" | "SPONSOR_REQUEST_FAILED" | "PERMIT2_APPROVAL_REQUIRED" | "SPONSORED_CALLS_UNSUPPORTED" | "SPONSORED_CALLS_NO_ID" | "SPONSORED_CALLS_NO_RECEIPT" | "BALANCE_ALL_FAILED" | "EARNINGS_ALL_FAILED" | "ALLOCATION_ALL_FAILED" | "VALIDATION_INVALID_DAYS";
|
|
1209
|
+
type OwneyErrorCode = "NOT_CONNECTED" | "NO_ACTIVE_CHAIN" | "WALLET_NO_ACCOUNTS" | "WALLET_ADDRESS_REQUIRED" | "WALLET_NOT_DEPLOYED" | "AGENT_NOT_FOUND" | "AGENT_CHAIN_INCOMPATIBLE" | "AGENT_EMPTY_LIST" | "AGENT_DISABLED" | "AGENT_ACTIVATION_PARTIAL_FAILURE" | "CHAIN_UNSUPPORTED" | "CHAIN_NO_COMPATIBLE_AGENTS" | "CHAIN_MISMATCH" | "ASSET_UNSUPPORTED" | "ASSET_NO_COMPATIBLE_AGENTS" | "DEPOSIT_BALANCE_UNAVAILABLE" | "DEPOSIT_PARTIAL_FAILURE" | "DEPOSIT_IN_PROGRESS" | "DEPOSIT_AMOUNT_BELOW_MINIMUM" | "DEPOSIT_INVALID_AMOUNT" | "DEPOSIT_CALLBACK_REQUIRED" | "DEPOSIT_CALLBACK_INVALID" | "DEPOSIT_NO_PERMITTED_TOKENS" | "DEPOSIT_INSUFFICIENT_BALANCE" | "WITHDRAW_IN_PROGRESS" | "WITHDRAW_NO_PERMITTED_TOKENS" | "WITHDRAW_BALANCE_UNAVAILABLE" | "WITHDRAW_INSUFFICIENT_BALANCE" | "WITHDRAW_ALL_FAILED" | "WITHDRAW_UNCONFIRMED" | "WITHDRAW_PARTIAL_FAILURE" | "WITHDRAW_FAILED" | "WITHDRAW_INVALID_AMOUNT" | "AGENT_RATE_LIMITED" | "API_ROUTING_ERROR" | "API_ROUTING_FAILED" | "API_NO_AGENTS" | "AGENT_API_ERROR" | "AGENT_AUTH_FAILED" | "AGENT_INVALID_RESPONSE" | "AGENT_TIMEOUT" | "AGENT_TRANSACTION_REVERTED" | "SPONSOR_REQUEST_FAILED" | "PERMIT2_APPROVAL_REQUIRED" | "SPONSORED_CALLS_UNSUPPORTED" | "SPONSORED_CALLS_NO_ID" | "SPONSORED_CALLS_NO_RECEIPT" | "BALANCE_ALL_FAILED" | "EARNINGS_ALL_FAILED" | "ALLOCATION_ALL_FAILED" | "VALIDATION_INVALID_DAYS";
|
|
1197
1210
|
declare class OwneyError extends Error {
|
|
1198
1211
|
readonly code: OwneyErrorCode;
|
|
1199
1212
|
readonly details?: Record<string, unknown>;
|