@owney/sdk 0.7.25-beta.13 → 0.7.25-beta.15
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 +1572 -534
- package/dist/index.d.cts +41 -6
- package/dist/index.d.ts +41 -6
- package/dist/index.js +1504 -463
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -138,13 +138,15 @@ interface IAgent {
|
|
|
138
138
|
*/
|
|
139
139
|
applyOrgPolicy?(state: ConnectionState, chainId: number, policy: OrgAgentConfig): Promise<void>;
|
|
140
140
|
deposit(state: ConnectionState, chainId: number, amount: string, asset: OwneySupportedTokens, depositCallback?: DepositCallback, onProgress?: FundingProgress): Promise<OwneyDepositResult>;
|
|
141
|
-
withdraw(state: ConnectionState, chainId: number, token: OwneySupportedTokens, amount?: string, onProgress?: FundingProgress, gasMode?: "auto" | "sponsored" | "paid"): Promise<AgentWithdrawResult>;
|
|
141
|
+
withdraw(state: ConnectionState, chainId: number, token: OwneySupportedTokens, amount?: string, onProgress?: FundingProgress, gasMode?: "auto" | "sponsored" | "paid", onBeforeSubmission?: FundingProgress): Promise<AgentWithdrawResult>;
|
|
142
142
|
/** Invalidate only the confirmed asset. This hook must not sign or submit transactions. */
|
|
143
143
|
invalidateFundingRead?(state: ConnectionState, chainId: number, asset: OwneySupportedTokens, refreshUntil?: number): void;
|
|
144
144
|
/** End accelerated balance reads only for the exact snapshot the caller displayed. */
|
|
145
145
|
endFundingBalanceRefresh?(state: ConnectionState, chainId: number, asset: OwneySupportedTokens, read: AssetReadMetadata): boolean;
|
|
146
146
|
getFundingHistory?(state: ConnectionState, chainId: number, options?: HistoryFilters): Promise<OwneyAgentHistory>;
|
|
147
147
|
getFundingWallet?(state: ConnectionState, chainId: number, asset: OwneySupportedTokens): Promise<string>;
|
|
148
|
+
/** Optional positive proof for a repeat deposit; unknown must fall back to portfolio validation. */
|
|
149
|
+
hasExistingDepositFunds?(state: ConnectionState, chainId: number, asset: OwneySupportedTokens): Promise<true | undefined>;
|
|
148
150
|
getBalances(state: ConnectionState, chainId: number, asset?: OwneySupportedTokens): Promise<AgentBalance>;
|
|
149
151
|
getEarnings(state: ConnectionState, chainId: number): Promise<AgentEarnings>;
|
|
150
152
|
/**
|
|
@@ -245,6 +247,11 @@ type WithdrawOptions = {
|
|
|
245
247
|
/** Exclude unresolved providers from aggregate withdrawals; direct agent requests are unchanged. */
|
|
246
248
|
excludeAgentIds?: AgentId[];
|
|
247
249
|
onProgress?: FundingProgress;
|
|
250
|
+
/**
|
|
251
|
+
* Durable pre-dispatch checkpoint for adapters with a recoverable operation ID.
|
|
252
|
+
* Rejection prevents submission; progress observers remain non-fatal.
|
|
253
|
+
*/
|
|
254
|
+
onBeforeSubmission?: FundingProgress;
|
|
248
255
|
asset: Asset;
|
|
249
256
|
amount?: string;
|
|
250
257
|
agentId?: AgentId;
|
|
@@ -296,6 +303,8 @@ type AgentsApyOptions = {
|
|
|
296
303
|
chainId?: number;
|
|
297
304
|
};
|
|
298
305
|
type DepositOptions = {
|
|
306
|
+
/** Resume only these already signed relayer bytes; never create a new authorization. */
|
|
307
|
+
resumeTxHash?: `0x${string}`;
|
|
299
308
|
onProgress?: FundingProgress;
|
|
300
309
|
amount: string;
|
|
301
310
|
asset: Asset;
|
|
@@ -305,6 +314,19 @@ type DepositOptions = {
|
|
|
305
314
|
};
|
|
306
315
|
|
|
307
316
|
type FundingStage = "pending" | "confirmed" | "unknown" | "failed" | "not-applicable";
|
|
317
|
+
/** Hash-bound v0.6 recovery metadata. Deliberately excludes the owner signature. */
|
|
318
|
+
type UnsignedUserOperationEvidence = {
|
|
319
|
+
sender: string;
|
|
320
|
+
nonce: string;
|
|
321
|
+
initCode: string;
|
|
322
|
+
callData: string;
|
|
323
|
+
callGasLimit: string;
|
|
324
|
+
verificationGasLimit: string;
|
|
325
|
+
preVerificationGas: string;
|
|
326
|
+
maxFeePerGas: string;
|
|
327
|
+
maxPriorityFeePerGas: string;
|
|
328
|
+
paymasterAndData: string;
|
|
329
|
+
};
|
|
308
330
|
/** Evidence about one provider leg. Amounts are token base units, never USD. */
|
|
309
331
|
interface FundingEvidence {
|
|
310
332
|
agentId: AgentId;
|
|
@@ -317,6 +339,8 @@ interface FundingEvidence {
|
|
|
317
339
|
txHash?: string;
|
|
318
340
|
/** Persisted before a sponsored EOA operation is sent. */
|
|
319
341
|
userOpHash?: string;
|
|
342
|
+
/** Lets recovery verify a consumed nonce even if a bundler forgets the operation. */
|
|
343
|
+
userOperation?: UnsignedUserOperationEvidence;
|
|
320
344
|
/** Base Account calls ID used to recover an uncertain wallet submission. */
|
|
321
345
|
callsId?: string;
|
|
322
346
|
blockNumber?: string;
|
|
@@ -331,7 +355,7 @@ interface FundingEvidence {
|
|
|
331
355
|
method?: "GET" | "POST";
|
|
332
356
|
path?: "/users/withdraw" | "/users/partial-withdraw";
|
|
333
357
|
elapsedMs?: number;
|
|
334
|
-
failure?: "network" | "unauthorized" | "forbidden" | "rate-limited" | "other";
|
|
358
|
+
failure?: "network" | "unauthorized" | "forbidden" | "rate-limited" | "insufficient-balance" | "session-key-missing" | "other";
|
|
335
359
|
};
|
|
336
360
|
transfer: FundingStage;
|
|
337
361
|
registration: FundingStage;
|
|
@@ -365,6 +389,8 @@ interface AgentWithdrawResult {
|
|
|
365
389
|
evidence?: FundingEvidence;
|
|
366
390
|
txHash?: string;
|
|
367
391
|
type: "full" | "partial";
|
|
392
|
+
/** Owner payout is confirmed, but clearing all MAX positions still needs verification. */
|
|
393
|
+
completion?: "unverified";
|
|
368
394
|
/** Smallest-unit amount, or a provider sentinel such as "all" for a full request. */
|
|
369
395
|
amount: string;
|
|
370
396
|
}
|
|
@@ -834,7 +860,14 @@ declare class OwneySDK {
|
|
|
834
860
|
refreshBalance?: boolean;
|
|
835
861
|
}): Promise<FundingEvidence>;
|
|
836
862
|
/** Resolve a saved sponsored-withdrawal ID without opening a wallet prompt. */
|
|
837
|
-
resolveSponsoredWithdrawalEvidence(evidence: FundingEvidence
|
|
863
|
+
resolveSponsoredWithdrawalEvidence(evidence: FundingEvidence, options?: {
|
|
864
|
+
submittedAt?: number;
|
|
865
|
+
}): Promise<FundingEvidence>;
|
|
866
|
+
/** Recover an EIP-5792 deposit or payout using this account's exact batch ID. */
|
|
867
|
+
resolveWalletCallsFundingEvidence(evidence: FundingEvidence, direction: "deposit" | "withdraw"): Promise<FundingEvidence>;
|
|
868
|
+
/** Whether a foreground deposit can resume the same signed batch, never a
|
|
869
|
+
* fresh authorization. The batch rail independently rechecks the exact plan. */
|
|
870
|
+
canResumePendingDeposit(evidences: FundingEvidence[], amount: string): Promise<boolean>;
|
|
838
871
|
/** A display acknowledgement controls polling only; it never confirms a financial outcome. */
|
|
839
872
|
endFundingBalanceRefresh(evidence: FundingEvidence, read: AssetReadMetadata): boolean;
|
|
840
873
|
/** History lookup for receipt recovery; adapters may not authenticate or sign here. */
|
|
@@ -1056,6 +1089,7 @@ declare class YieldseekerAgent implements IAgent {
|
|
|
1056
1089
|
private getReceiptClient;
|
|
1057
1090
|
/** Reads the actual proxy implementation; Yieldseeker's API walletType is not a version check. */
|
|
1058
1091
|
getWalletStatus(state: ConnectionState, chainId: number, asset: OwneySupportedTokens, useCachedV2?: boolean): Promise<YieldseekerWalletStatus | null>;
|
|
1092
|
+
private rememberWalletStatus;
|
|
1059
1093
|
/** Explicit owner action. This never runs as a side effect of withdrawal. */
|
|
1060
1094
|
upgradeWallet(state: ConnectionState, chainId: number, asset: OwneySupportedTokens, gasMode?: "paid" | "sponsored"): Promise<{
|
|
1061
1095
|
txHash: Hex;
|
|
@@ -1064,12 +1098,13 @@ declare class YieldseekerAgent implements IAgent {
|
|
|
1064
1098
|
disconnect(): Promise<void>;
|
|
1065
1099
|
activateAgent(state: ConnectionState, chainId: number, asset?: OwneySupportedTokens): Promise<void>;
|
|
1066
1100
|
deposit(state: ConnectionState, chainId: number, amount: string, asset: OwneySupportedTokens, depositCallback?: DepositCallback, onProgress?: FundingProgress): Promise<OwneyDepositResult>;
|
|
1067
|
-
withdraw(state: ConnectionState, chainId: number, asset: OwneySupportedTokens, amount?: string, onProgress?: FundingProgress, gasMode?: "auto" | "sponsored" | "paid"): Promise<AgentWithdrawResult>;
|
|
1101
|
+
withdraw(state: ConnectionState, chainId: number, asset: OwneySupportedTokens, amount?: string, onProgress?: FundingProgress, gasMode?: "auto" | "sponsored" | "paid", onBeforeSubmission?: FundingProgress): Promise<AgentWithdrawResult>;
|
|
1068
1102
|
private withdrawInternal;
|
|
1069
1103
|
getBalances(state: ConnectionState, chainId: number, asset?: OwneySupportedTokens): Promise<AgentBalance>;
|
|
1070
1104
|
invalidateFundingRead(state: ConnectionState, chainId: number, asset: OwneySupportedTokens, refreshUntil?: number): void;
|
|
1071
1105
|
endFundingBalanceRefresh(state: ConnectionState, chainId: number, asset: OwneySupportedTokens, read: AssetReadMetadata): boolean;
|
|
1072
1106
|
getFundingWallet(state: ConnectionState, chainId: number, asset: OwneySupportedTokens): Promise<string>;
|
|
1107
|
+
hasExistingDepositFunds(state: ConnectionState, chainId: number, asset: OwneySupportedTokens): Promise<true | undefined>;
|
|
1073
1108
|
getEarnings(state: ConnectionState, chainId: number): Promise<AgentEarnings>;
|
|
1074
1109
|
getAccountApy(state: ConnectionState, chainId: number, days: DailyApyDays, tokenSymbol?: string): Promise<AccountAgentApy>;
|
|
1075
1110
|
getHistory(state: ConnectionState, chainId: number, options?: HistoryFilters): Promise<OwneyAgentHistory>;
|
|
@@ -1119,7 +1154,7 @@ declare class YieldseekerAgent implements IAgent {
|
|
|
1119
1154
|
private invalidResponse;
|
|
1120
1155
|
}
|
|
1121
1156
|
|
|
1122
|
-
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_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";
|
|
1157
|
+
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";
|
|
1123
1158
|
declare class OwneyError extends Error {
|
|
1124
1159
|
readonly code: OwneyErrorCode;
|
|
1125
1160
|
readonly details?: Record<string, unknown>;
|
|
@@ -1185,4 +1220,4 @@ type OwneySIWXConfig = {
|
|
|
1185
1220
|
*/
|
|
1186
1221
|
declare function createOwneySIWX(config: OwneySIWXConfig): SIWXConfig;
|
|
1187
1222
|
|
|
1188
|
-
export { type AccountAgentApy, type AccountApyOptions, type AccountDailyEarnings, type AgentApy, type AgentApyDetails, type AgentBalance, AgentChainIncompatibleError, type AgentEarnings, type AgentHistoryEntry, type AgentHistoryPosition, type AgentId, AgentNotFoundError, type AgentSupportedAsset, type AgentSupportedAssets, type AgentUserProfile, type AgentWithdrawResult, type AgentsApyOptions, type AllocationAgentApy, type AllocationApyOptions, type ApyByChainAndAsset, type ApyHistoryPoint, type Asset, type AssetDailyEarnings, type AssetReadMetadata, type AvailableAgent, type AvailableAgentsOptions, type ConnectionState, type DailyApyDays, type DailyEarningsOptions, type DailyEarningsPoint, type DepositCallback, type DepositOptions, type FundingEvidence, type FundingProgress, type FundingStage, type HistoryAction, type HistoryFilters, type HistoryOptions, type HistoryTransaction, type IAgent, InvalidHistoryCursorError, type LookbackDays, NotConnectedError, type OwneyAccountApy, type OwneyAgentApy, type OwneyAgentHistory, type OwneyAllocationApy, type OwneyBalances, type OwneyDepositResult, type OwneyEarnings, OwneyError, type OwneyErrorCode, type OwneyMultiDepositResult, type OwneyPosition, OwneySDK, type OwneySDKConfig, type OwneySIWXConfig, type OwneySupportedChainId, type OwneySupportedChains, type OwneySupportedTokens, type OwneyToken, type OwneyUserProfile, type OwneyWithdrawResult, type RebalanceLog, type RpcUrlsConfig, type WithdrawOptions, YieldseekerAgent, type YieldseekerWalletStatus, type ZyfaiRpcUrlsConfig, createOwneySIWX, setOwneyDebug };
|
|
1223
|
+
export { type AccountAgentApy, type AccountApyOptions, type AccountDailyEarnings, type AgentApy, type AgentApyDetails, type AgentBalance, AgentChainIncompatibleError, type AgentEarnings, type AgentHistoryEntry, type AgentHistoryPosition, type AgentId, AgentNotFoundError, type AgentSupportedAsset, type AgentSupportedAssets, type AgentUserProfile, type AgentWithdrawResult, type AgentsApyOptions, type AllocationAgentApy, type AllocationApyOptions, type ApyByChainAndAsset, type ApyHistoryPoint, type Asset, type AssetDailyEarnings, type AssetReadMetadata, type AvailableAgent, type AvailableAgentsOptions, type ConnectionState, type DailyApyDays, type DailyEarningsOptions, type DailyEarningsPoint, type DepositCallback, type DepositOptions, type FundingEvidence, type FundingProgress, type FundingStage, type HistoryAction, type HistoryFilters, type HistoryOptions, type HistoryTransaction, type IAgent, InvalidHistoryCursorError, type LookbackDays, NotConnectedError, type OwneyAccountApy, type OwneyAgentApy, type OwneyAgentHistory, type OwneyAllocationApy, type OwneyBalances, type OwneyDepositResult, type OwneyEarnings, OwneyError, type OwneyErrorCode, type OwneyMultiDepositResult, type OwneyPosition, OwneySDK, type OwneySDKConfig, type OwneySIWXConfig, type OwneySupportedChainId, type OwneySupportedChains, type OwneySupportedTokens, type OwneyToken, type OwneyUserProfile, type OwneyWithdrawResult, type RebalanceLog, type RpcUrlsConfig, type UnsignedUserOperationEvidence, type WithdrawOptions, YieldseekerAgent, type YieldseekerWalletStatus, type ZyfaiRpcUrlsConfig, createOwneySIWX, setOwneyDebug };
|
package/dist/index.d.ts
CHANGED
|
@@ -138,13 +138,15 @@ interface IAgent {
|
|
|
138
138
|
*/
|
|
139
139
|
applyOrgPolicy?(state: ConnectionState, chainId: number, policy: OrgAgentConfig): Promise<void>;
|
|
140
140
|
deposit(state: ConnectionState, chainId: number, amount: string, asset: OwneySupportedTokens, depositCallback?: DepositCallback, onProgress?: FundingProgress): Promise<OwneyDepositResult>;
|
|
141
|
-
withdraw(state: ConnectionState, chainId: number, token: OwneySupportedTokens, amount?: string, onProgress?: FundingProgress, gasMode?: "auto" | "sponsored" | "paid"): Promise<AgentWithdrawResult>;
|
|
141
|
+
withdraw(state: ConnectionState, chainId: number, token: OwneySupportedTokens, amount?: string, onProgress?: FundingProgress, gasMode?: "auto" | "sponsored" | "paid", onBeforeSubmission?: FundingProgress): Promise<AgentWithdrawResult>;
|
|
142
142
|
/** Invalidate only the confirmed asset. This hook must not sign or submit transactions. */
|
|
143
143
|
invalidateFundingRead?(state: ConnectionState, chainId: number, asset: OwneySupportedTokens, refreshUntil?: number): void;
|
|
144
144
|
/** End accelerated balance reads only for the exact snapshot the caller displayed. */
|
|
145
145
|
endFundingBalanceRefresh?(state: ConnectionState, chainId: number, asset: OwneySupportedTokens, read: AssetReadMetadata): boolean;
|
|
146
146
|
getFundingHistory?(state: ConnectionState, chainId: number, options?: HistoryFilters): Promise<OwneyAgentHistory>;
|
|
147
147
|
getFundingWallet?(state: ConnectionState, chainId: number, asset: OwneySupportedTokens): Promise<string>;
|
|
148
|
+
/** Optional positive proof for a repeat deposit; unknown must fall back to portfolio validation. */
|
|
149
|
+
hasExistingDepositFunds?(state: ConnectionState, chainId: number, asset: OwneySupportedTokens): Promise<true | undefined>;
|
|
148
150
|
getBalances(state: ConnectionState, chainId: number, asset?: OwneySupportedTokens): Promise<AgentBalance>;
|
|
149
151
|
getEarnings(state: ConnectionState, chainId: number): Promise<AgentEarnings>;
|
|
150
152
|
/**
|
|
@@ -245,6 +247,11 @@ type WithdrawOptions = {
|
|
|
245
247
|
/** Exclude unresolved providers from aggregate withdrawals; direct agent requests are unchanged. */
|
|
246
248
|
excludeAgentIds?: AgentId[];
|
|
247
249
|
onProgress?: FundingProgress;
|
|
250
|
+
/**
|
|
251
|
+
* Durable pre-dispatch checkpoint for adapters with a recoverable operation ID.
|
|
252
|
+
* Rejection prevents submission; progress observers remain non-fatal.
|
|
253
|
+
*/
|
|
254
|
+
onBeforeSubmission?: FundingProgress;
|
|
248
255
|
asset: Asset;
|
|
249
256
|
amount?: string;
|
|
250
257
|
agentId?: AgentId;
|
|
@@ -296,6 +303,8 @@ type AgentsApyOptions = {
|
|
|
296
303
|
chainId?: number;
|
|
297
304
|
};
|
|
298
305
|
type DepositOptions = {
|
|
306
|
+
/** Resume only these already signed relayer bytes; never create a new authorization. */
|
|
307
|
+
resumeTxHash?: `0x${string}`;
|
|
299
308
|
onProgress?: FundingProgress;
|
|
300
309
|
amount: string;
|
|
301
310
|
asset: Asset;
|
|
@@ -305,6 +314,19 @@ type DepositOptions = {
|
|
|
305
314
|
};
|
|
306
315
|
|
|
307
316
|
type FundingStage = "pending" | "confirmed" | "unknown" | "failed" | "not-applicable";
|
|
317
|
+
/** Hash-bound v0.6 recovery metadata. Deliberately excludes the owner signature. */
|
|
318
|
+
type UnsignedUserOperationEvidence = {
|
|
319
|
+
sender: string;
|
|
320
|
+
nonce: string;
|
|
321
|
+
initCode: string;
|
|
322
|
+
callData: string;
|
|
323
|
+
callGasLimit: string;
|
|
324
|
+
verificationGasLimit: string;
|
|
325
|
+
preVerificationGas: string;
|
|
326
|
+
maxFeePerGas: string;
|
|
327
|
+
maxPriorityFeePerGas: string;
|
|
328
|
+
paymasterAndData: string;
|
|
329
|
+
};
|
|
308
330
|
/** Evidence about one provider leg. Amounts are token base units, never USD. */
|
|
309
331
|
interface FundingEvidence {
|
|
310
332
|
agentId: AgentId;
|
|
@@ -317,6 +339,8 @@ interface FundingEvidence {
|
|
|
317
339
|
txHash?: string;
|
|
318
340
|
/** Persisted before a sponsored EOA operation is sent. */
|
|
319
341
|
userOpHash?: string;
|
|
342
|
+
/** Lets recovery verify a consumed nonce even if a bundler forgets the operation. */
|
|
343
|
+
userOperation?: UnsignedUserOperationEvidence;
|
|
320
344
|
/** Base Account calls ID used to recover an uncertain wallet submission. */
|
|
321
345
|
callsId?: string;
|
|
322
346
|
blockNumber?: string;
|
|
@@ -331,7 +355,7 @@ interface FundingEvidence {
|
|
|
331
355
|
method?: "GET" | "POST";
|
|
332
356
|
path?: "/users/withdraw" | "/users/partial-withdraw";
|
|
333
357
|
elapsedMs?: number;
|
|
334
|
-
failure?: "network" | "unauthorized" | "forbidden" | "rate-limited" | "other";
|
|
358
|
+
failure?: "network" | "unauthorized" | "forbidden" | "rate-limited" | "insufficient-balance" | "session-key-missing" | "other";
|
|
335
359
|
};
|
|
336
360
|
transfer: FundingStage;
|
|
337
361
|
registration: FundingStage;
|
|
@@ -365,6 +389,8 @@ interface AgentWithdrawResult {
|
|
|
365
389
|
evidence?: FundingEvidence;
|
|
366
390
|
txHash?: string;
|
|
367
391
|
type: "full" | "partial";
|
|
392
|
+
/** Owner payout is confirmed, but clearing all MAX positions still needs verification. */
|
|
393
|
+
completion?: "unverified";
|
|
368
394
|
/** Smallest-unit amount, or a provider sentinel such as "all" for a full request. */
|
|
369
395
|
amount: string;
|
|
370
396
|
}
|
|
@@ -834,7 +860,14 @@ declare class OwneySDK {
|
|
|
834
860
|
refreshBalance?: boolean;
|
|
835
861
|
}): Promise<FundingEvidence>;
|
|
836
862
|
/** Resolve a saved sponsored-withdrawal ID without opening a wallet prompt. */
|
|
837
|
-
resolveSponsoredWithdrawalEvidence(evidence: FundingEvidence
|
|
863
|
+
resolveSponsoredWithdrawalEvidence(evidence: FundingEvidence, options?: {
|
|
864
|
+
submittedAt?: number;
|
|
865
|
+
}): Promise<FundingEvidence>;
|
|
866
|
+
/** Recover an EIP-5792 deposit or payout using this account's exact batch ID. */
|
|
867
|
+
resolveWalletCallsFundingEvidence(evidence: FundingEvidence, direction: "deposit" | "withdraw"): Promise<FundingEvidence>;
|
|
868
|
+
/** Whether a foreground deposit can resume the same signed batch, never a
|
|
869
|
+
* fresh authorization. The batch rail independently rechecks the exact plan. */
|
|
870
|
+
canResumePendingDeposit(evidences: FundingEvidence[], amount: string): Promise<boolean>;
|
|
838
871
|
/** A display acknowledgement controls polling only; it never confirms a financial outcome. */
|
|
839
872
|
endFundingBalanceRefresh(evidence: FundingEvidence, read: AssetReadMetadata): boolean;
|
|
840
873
|
/** History lookup for receipt recovery; adapters may not authenticate or sign here. */
|
|
@@ -1056,6 +1089,7 @@ declare class YieldseekerAgent implements IAgent {
|
|
|
1056
1089
|
private getReceiptClient;
|
|
1057
1090
|
/** Reads the actual proxy implementation; Yieldseeker's API walletType is not a version check. */
|
|
1058
1091
|
getWalletStatus(state: ConnectionState, chainId: number, asset: OwneySupportedTokens, useCachedV2?: boolean): Promise<YieldseekerWalletStatus | null>;
|
|
1092
|
+
private rememberWalletStatus;
|
|
1059
1093
|
/** Explicit owner action. This never runs as a side effect of withdrawal. */
|
|
1060
1094
|
upgradeWallet(state: ConnectionState, chainId: number, asset: OwneySupportedTokens, gasMode?: "paid" | "sponsored"): Promise<{
|
|
1061
1095
|
txHash: Hex;
|
|
@@ -1064,12 +1098,13 @@ declare class YieldseekerAgent implements IAgent {
|
|
|
1064
1098
|
disconnect(): Promise<void>;
|
|
1065
1099
|
activateAgent(state: ConnectionState, chainId: number, asset?: OwneySupportedTokens): Promise<void>;
|
|
1066
1100
|
deposit(state: ConnectionState, chainId: number, amount: string, asset: OwneySupportedTokens, depositCallback?: DepositCallback, onProgress?: FundingProgress): Promise<OwneyDepositResult>;
|
|
1067
|
-
withdraw(state: ConnectionState, chainId: number, asset: OwneySupportedTokens, amount?: string, onProgress?: FundingProgress, gasMode?: "auto" | "sponsored" | "paid"): Promise<AgentWithdrawResult>;
|
|
1101
|
+
withdraw(state: ConnectionState, chainId: number, asset: OwneySupportedTokens, amount?: string, onProgress?: FundingProgress, gasMode?: "auto" | "sponsored" | "paid", onBeforeSubmission?: FundingProgress): Promise<AgentWithdrawResult>;
|
|
1068
1102
|
private withdrawInternal;
|
|
1069
1103
|
getBalances(state: ConnectionState, chainId: number, asset?: OwneySupportedTokens): Promise<AgentBalance>;
|
|
1070
1104
|
invalidateFundingRead(state: ConnectionState, chainId: number, asset: OwneySupportedTokens, refreshUntil?: number): void;
|
|
1071
1105
|
endFundingBalanceRefresh(state: ConnectionState, chainId: number, asset: OwneySupportedTokens, read: AssetReadMetadata): boolean;
|
|
1072
1106
|
getFundingWallet(state: ConnectionState, chainId: number, asset: OwneySupportedTokens): Promise<string>;
|
|
1107
|
+
hasExistingDepositFunds(state: ConnectionState, chainId: number, asset: OwneySupportedTokens): Promise<true | undefined>;
|
|
1073
1108
|
getEarnings(state: ConnectionState, chainId: number): Promise<AgentEarnings>;
|
|
1074
1109
|
getAccountApy(state: ConnectionState, chainId: number, days: DailyApyDays, tokenSymbol?: string): Promise<AccountAgentApy>;
|
|
1075
1110
|
getHistory(state: ConnectionState, chainId: number, options?: HistoryFilters): Promise<OwneyAgentHistory>;
|
|
@@ -1119,7 +1154,7 @@ declare class YieldseekerAgent implements IAgent {
|
|
|
1119
1154
|
private invalidResponse;
|
|
1120
1155
|
}
|
|
1121
1156
|
|
|
1122
|
-
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_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";
|
|
1157
|
+
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";
|
|
1123
1158
|
declare class OwneyError extends Error {
|
|
1124
1159
|
readonly code: OwneyErrorCode;
|
|
1125
1160
|
readonly details?: Record<string, unknown>;
|
|
@@ -1185,4 +1220,4 @@ type OwneySIWXConfig = {
|
|
|
1185
1220
|
*/
|
|
1186
1221
|
declare function createOwneySIWX(config: OwneySIWXConfig): SIWXConfig;
|
|
1187
1222
|
|
|
1188
|
-
export { type AccountAgentApy, type AccountApyOptions, type AccountDailyEarnings, type AgentApy, type AgentApyDetails, type AgentBalance, AgentChainIncompatibleError, type AgentEarnings, type AgentHistoryEntry, type AgentHistoryPosition, type AgentId, AgentNotFoundError, type AgentSupportedAsset, type AgentSupportedAssets, type AgentUserProfile, type AgentWithdrawResult, type AgentsApyOptions, type AllocationAgentApy, type AllocationApyOptions, type ApyByChainAndAsset, type ApyHistoryPoint, type Asset, type AssetDailyEarnings, type AssetReadMetadata, type AvailableAgent, type AvailableAgentsOptions, type ConnectionState, type DailyApyDays, type DailyEarningsOptions, type DailyEarningsPoint, type DepositCallback, type DepositOptions, type FundingEvidence, type FundingProgress, type FundingStage, type HistoryAction, type HistoryFilters, type HistoryOptions, type HistoryTransaction, type IAgent, InvalidHistoryCursorError, type LookbackDays, NotConnectedError, type OwneyAccountApy, type OwneyAgentApy, type OwneyAgentHistory, type OwneyAllocationApy, type OwneyBalances, type OwneyDepositResult, type OwneyEarnings, OwneyError, type OwneyErrorCode, type OwneyMultiDepositResult, type OwneyPosition, OwneySDK, type OwneySDKConfig, type OwneySIWXConfig, type OwneySupportedChainId, type OwneySupportedChains, type OwneySupportedTokens, type OwneyToken, type OwneyUserProfile, type OwneyWithdrawResult, type RebalanceLog, type RpcUrlsConfig, type WithdrawOptions, YieldseekerAgent, type YieldseekerWalletStatus, type ZyfaiRpcUrlsConfig, createOwneySIWX, setOwneyDebug };
|
|
1223
|
+
export { type AccountAgentApy, type AccountApyOptions, type AccountDailyEarnings, type AgentApy, type AgentApyDetails, type AgentBalance, AgentChainIncompatibleError, type AgentEarnings, type AgentHistoryEntry, type AgentHistoryPosition, type AgentId, AgentNotFoundError, type AgentSupportedAsset, type AgentSupportedAssets, type AgentUserProfile, type AgentWithdrawResult, type AgentsApyOptions, type AllocationAgentApy, type AllocationApyOptions, type ApyByChainAndAsset, type ApyHistoryPoint, type Asset, type AssetDailyEarnings, type AssetReadMetadata, type AvailableAgent, type AvailableAgentsOptions, type ConnectionState, type DailyApyDays, type DailyEarningsOptions, type DailyEarningsPoint, type DepositCallback, type DepositOptions, type FundingEvidence, type FundingProgress, type FundingStage, type HistoryAction, type HistoryFilters, type HistoryOptions, type HistoryTransaction, type IAgent, InvalidHistoryCursorError, type LookbackDays, NotConnectedError, type OwneyAccountApy, type OwneyAgentApy, type OwneyAgentHistory, type OwneyAllocationApy, type OwneyBalances, type OwneyDepositResult, type OwneyEarnings, OwneyError, type OwneyErrorCode, type OwneyMultiDepositResult, type OwneyPosition, OwneySDK, type OwneySDKConfig, type OwneySIWXConfig, type OwneySupportedChainId, type OwneySupportedChains, type OwneySupportedTokens, type OwneyToken, type OwneyUserProfile, type OwneyWithdrawResult, type RebalanceLog, type RpcUrlsConfig, type UnsignedUserOperationEvidence, type WithdrawOptions, YieldseekerAgent, type YieldseekerWalletStatus, type ZyfaiRpcUrlsConfig, createOwneySIWX, setOwneyDebug };
|