@owney/sdk 0.7.25-beta.19 → 0.7.25-beta.21
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 +1254 -656
- package/dist/index.d.cts +26 -8
- package/dist/index.d.ts +26 -8
- package/dist/index.js +1176 -576
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -137,7 +137,7 @@ interface IAgent {
|
|
|
137
137
|
* unchanged rather than break the connect.
|
|
138
138
|
*/
|
|
139
139
|
applyOrgPolicy?(state: ConnectionState, chainId: number, policy: OrgAgentConfig): Promise<void>;
|
|
140
|
-
deposit(state: ConnectionState, chainId: number, amount: string, asset: OwneySupportedTokens, depositCallback?: DepositCallback, onProgress?: FundingProgress): Promise<OwneyDepositResult>;
|
|
140
|
+
deposit(state: ConnectionState, chainId: number, amount: string, asset: OwneySupportedTokens, depositCallback?: DepositCallback, onProgress?: FundingProgress, onBeforeSubmission?: (evidence: FundingEvidence) => void | Promise<void>): Promise<OwneyDepositResult>;
|
|
141
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;
|
|
@@ -314,6 +314,9 @@ type DepositOptions = {
|
|
|
314
314
|
/** Resume only these already signed relayer bytes; never create a new authorization. */
|
|
315
315
|
resumeTxHash?: `0x${string}`;
|
|
316
316
|
onProgress?: FundingProgress;
|
|
317
|
+
/** Awaited immediately before dispatch. Throwing prevents submission.
|
|
318
|
+
* All legs of an atomic batch are checkpointed together. */
|
|
319
|
+
onBeforeSubmission?: (evidence: FundingEvidence[]) => void | Promise<void>;
|
|
317
320
|
amount: string;
|
|
318
321
|
asset: Asset;
|
|
319
322
|
depositCallback?: DepositCallback;
|
|
@@ -344,6 +347,10 @@ interface FundingEvidence {
|
|
|
344
347
|
agentWallet?: string;
|
|
345
348
|
intendedAmount: string;
|
|
346
349
|
confirmedAmount?: string;
|
|
350
|
+
/** Receipt delivery and fulfillment of a typed requested amount are separate facts. */
|
|
351
|
+
amountCompletion?: "complete" | "shortfall";
|
|
352
|
+
/** Verified difference between the typed request and the actual owner payout. */
|
|
353
|
+
shortfallAmount?: string;
|
|
347
354
|
txHash?: string;
|
|
348
355
|
/** Persisted before a sponsored EOA operation is sent. */
|
|
349
356
|
userOpHash?: string;
|
|
@@ -351,6 +358,8 @@ interface FundingEvidence {
|
|
|
351
358
|
userOperation?: UnsignedUserOperationEvidence;
|
|
352
359
|
/** Base Account calls ID used to recover an uncertain wallet submission. */
|
|
353
360
|
callsId?: string;
|
|
361
|
+
/** Deposit execution was attempted, rather than only prepared. Not confirmation. */
|
|
362
|
+
depositSubmission?: "started";
|
|
354
363
|
blockNumber?: string;
|
|
355
364
|
logIndexes?: number[];
|
|
356
365
|
transferLogs?: {
|
|
@@ -405,9 +414,10 @@ interface AgentWithdrawResult {
|
|
|
405
414
|
evidence?: FundingEvidence;
|
|
406
415
|
txHash?: string;
|
|
407
416
|
type: "full" | "partial";
|
|
408
|
-
/** Owner payout
|
|
417
|
+
/** Owner payout or clearing all MAX positions still needs verification. */
|
|
409
418
|
completion?: "unverified";
|
|
410
|
-
/**
|
|
419
|
+
/** Confirmed smallest-unit amount; "0" when no owner payout is verified.
|
|
420
|
+
* Legacy providers may return a sentinel such as "all" for a full request. */
|
|
411
421
|
amount: string;
|
|
412
422
|
/** Yieldseeker typed withdrawal fulfilled after an exactly verified fee
|
|
413
423
|
* deduction. Amount remains the confirmed net owner payout, and the gross
|
|
@@ -420,8 +430,9 @@ interface AgentWithdrawResult {
|
|
|
420
430
|
interface OwneyWithdrawResult {
|
|
421
431
|
agentResult: Record<AgentId, AgentWithdrawResult>;
|
|
422
432
|
/**
|
|
423
|
-
* Sum of
|
|
424
|
-
*
|
|
433
|
+
* Sum of confirmed smallest-unit amounts; null while any returned leg's
|
|
434
|
+
* payout is not yet known, including typed requests accepted asynchronously.
|
|
435
|
+
* Evidence-less custom adapters retain their confirmed-amount contract.
|
|
425
436
|
*/
|
|
426
437
|
totalWithdrawn: string | null;
|
|
427
438
|
}
|
|
@@ -704,6 +715,8 @@ declare class OwneySDK {
|
|
|
704
715
|
*/
|
|
705
716
|
private disabledAgents;
|
|
706
717
|
private state;
|
|
718
|
+
private connectionRevision;
|
|
719
|
+
private disconnectingAgents;
|
|
707
720
|
private apiKey;
|
|
708
721
|
private orgAgentConfig;
|
|
709
722
|
private orgAgentConfigPromise;
|
|
@@ -721,6 +734,7 @@ declare class OwneySDK {
|
|
|
721
734
|
private readonly recoveredFundingReads;
|
|
722
735
|
private fundingBalanceChecks;
|
|
723
736
|
private readonly activationChecks;
|
|
737
|
+
private readonly withdrawalSubmissions;
|
|
724
738
|
private readAgent;
|
|
725
739
|
private initializingAgentsPromise;
|
|
726
740
|
constructor(config: OwneySDKConfig);
|
|
@@ -735,6 +749,8 @@ declare class OwneySDK {
|
|
|
735
749
|
* After calling this, `connect()` must be called again before using agent methods.
|
|
736
750
|
*/
|
|
737
751
|
disconnect(): Promise<void>;
|
|
752
|
+
private clearConnectionState;
|
|
753
|
+
private disconnectAgents;
|
|
738
754
|
private isAgentDisabled;
|
|
739
755
|
/**
|
|
740
756
|
* Check if the SDK has an active connection state.
|
|
@@ -883,6 +899,7 @@ declare class OwneySDK {
|
|
|
883
899
|
inspectFunding(evidence: FundingEvidence, direction: "deposit" | "withdraw", options?: {
|
|
884
900
|
balanceRefreshUntil?: number;
|
|
885
901
|
refreshBalance?: boolean;
|
|
902
|
+
requireAmountMatch?: boolean;
|
|
886
903
|
}): Promise<FundingEvidence>;
|
|
887
904
|
/** Resolve a saved sponsored-withdrawal ID without opening a wallet prompt. */
|
|
888
905
|
resolveSponsoredWithdrawalEvidence(evidence: FundingEvidence, options?: {
|
|
@@ -1068,7 +1085,7 @@ type YieldseekerAgentOptions = {
|
|
|
1068
1085
|
/** Dedicated read transport; Base is used for receipt polling. */
|
|
1069
1086
|
rpcUrls?: RpcUrlsConfig;
|
|
1070
1087
|
/** Test seam for the wallet-submission/receipt boundary. */
|
|
1071
|
-
transactionExecutor?: (state: ConnectionState, chainId: number, transaction: YieldseekerTransaction) => Promise<Hex>;
|
|
1088
|
+
transactionExecutor?: (state: ConnectionState, chainId: number, transaction: YieldseekerTransaction, onReceipt?: (receipt: viem.TransactionReceipt) => void) => Promise<Hex>;
|
|
1072
1089
|
/** Test seam for transactions submitted outside transactionExecutor. */
|
|
1073
1090
|
unwindReceiptWaiter?: (state: ConnectionState, chainId: number, transactionHash: Hex) => Promise<void>;
|
|
1074
1091
|
};
|
|
@@ -1095,6 +1112,7 @@ declare class YieldseekerAgent implements IAgent {
|
|
|
1095
1112
|
private readonly routingApiBaseUrl?;
|
|
1096
1113
|
private receiptClient?;
|
|
1097
1114
|
private readonly withdrawalVersionCache;
|
|
1115
|
+
private readonly pendingUpgrades;
|
|
1098
1116
|
private readonly transactionExecutor?;
|
|
1099
1117
|
private readonly unwindReceiptWaiter?;
|
|
1100
1118
|
private readonly agentContexts;
|
|
@@ -1127,7 +1145,7 @@ declare class YieldseekerAgent implements IAgent {
|
|
|
1127
1145
|
}>;
|
|
1128
1146
|
disconnect(): Promise<void>;
|
|
1129
1147
|
activateAgent(state: ConnectionState, chainId: number, asset?: OwneySupportedTokens): Promise<void>;
|
|
1130
|
-
deposit(state: ConnectionState, chainId: number, amount: string, asset: OwneySupportedTokens, depositCallback?: DepositCallback, onProgress?: FundingProgress): Promise<OwneyDepositResult>;
|
|
1148
|
+
deposit(state: ConnectionState, chainId: number, amount: string, asset: OwneySupportedTokens, depositCallback?: DepositCallback, onProgress?: FundingProgress, onBeforeSubmission?: (evidence: FundingEvidence) => void | Promise<void>): Promise<OwneyDepositResult>;
|
|
1131
1149
|
withdraw(state: ConnectionState, chainId: number, asset: OwneySupportedTokens, amount?: string, onProgress?: FundingProgress, gasMode?: "auto" | "sponsored" | "paid", onBeforeSubmission?: FundingProgress): Promise<AgentWithdrawResult>;
|
|
1132
1150
|
private withdrawInternal;
|
|
1133
1151
|
/** A withdrawal-only liquidity floor; display snapshots never authorize it. */
|
|
@@ -1193,7 +1211,7 @@ declare class YieldseekerAgent implements IAgent {
|
|
|
1193
1211
|
private invalidResponse;
|
|
1194
1212
|
}
|
|
1195
1213
|
|
|
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";
|
|
1214
|
+
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_CHECKPOINT_FAILED" | "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
1215
|
declare class OwneyError extends Error {
|
|
1198
1216
|
readonly code: OwneyErrorCode;
|
|
1199
1217
|
readonly details?: Record<string, unknown>;
|
package/dist/index.d.ts
CHANGED
|
@@ -137,7 +137,7 @@ interface IAgent {
|
|
|
137
137
|
* unchanged rather than break the connect.
|
|
138
138
|
*/
|
|
139
139
|
applyOrgPolicy?(state: ConnectionState, chainId: number, policy: OrgAgentConfig): Promise<void>;
|
|
140
|
-
deposit(state: ConnectionState, chainId: number, amount: string, asset: OwneySupportedTokens, depositCallback?: DepositCallback, onProgress?: FundingProgress): Promise<OwneyDepositResult>;
|
|
140
|
+
deposit(state: ConnectionState, chainId: number, amount: string, asset: OwneySupportedTokens, depositCallback?: DepositCallback, onProgress?: FundingProgress, onBeforeSubmission?: (evidence: FundingEvidence) => void | Promise<void>): Promise<OwneyDepositResult>;
|
|
141
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;
|
|
@@ -314,6 +314,9 @@ type DepositOptions = {
|
|
|
314
314
|
/** Resume only these already signed relayer bytes; never create a new authorization. */
|
|
315
315
|
resumeTxHash?: `0x${string}`;
|
|
316
316
|
onProgress?: FundingProgress;
|
|
317
|
+
/** Awaited immediately before dispatch. Throwing prevents submission.
|
|
318
|
+
* All legs of an atomic batch are checkpointed together. */
|
|
319
|
+
onBeforeSubmission?: (evidence: FundingEvidence[]) => void | Promise<void>;
|
|
317
320
|
amount: string;
|
|
318
321
|
asset: Asset;
|
|
319
322
|
depositCallback?: DepositCallback;
|
|
@@ -344,6 +347,10 @@ interface FundingEvidence {
|
|
|
344
347
|
agentWallet?: string;
|
|
345
348
|
intendedAmount: string;
|
|
346
349
|
confirmedAmount?: string;
|
|
350
|
+
/** Receipt delivery and fulfillment of a typed requested amount are separate facts. */
|
|
351
|
+
amountCompletion?: "complete" | "shortfall";
|
|
352
|
+
/** Verified difference between the typed request and the actual owner payout. */
|
|
353
|
+
shortfallAmount?: string;
|
|
347
354
|
txHash?: string;
|
|
348
355
|
/** Persisted before a sponsored EOA operation is sent. */
|
|
349
356
|
userOpHash?: string;
|
|
@@ -351,6 +358,8 @@ interface FundingEvidence {
|
|
|
351
358
|
userOperation?: UnsignedUserOperationEvidence;
|
|
352
359
|
/** Base Account calls ID used to recover an uncertain wallet submission. */
|
|
353
360
|
callsId?: string;
|
|
361
|
+
/** Deposit execution was attempted, rather than only prepared. Not confirmation. */
|
|
362
|
+
depositSubmission?: "started";
|
|
354
363
|
blockNumber?: string;
|
|
355
364
|
logIndexes?: number[];
|
|
356
365
|
transferLogs?: {
|
|
@@ -405,9 +414,10 @@ interface AgentWithdrawResult {
|
|
|
405
414
|
evidence?: FundingEvidence;
|
|
406
415
|
txHash?: string;
|
|
407
416
|
type: "full" | "partial";
|
|
408
|
-
/** Owner payout
|
|
417
|
+
/** Owner payout or clearing all MAX positions still needs verification. */
|
|
409
418
|
completion?: "unverified";
|
|
410
|
-
/**
|
|
419
|
+
/** Confirmed smallest-unit amount; "0" when no owner payout is verified.
|
|
420
|
+
* Legacy providers may return a sentinel such as "all" for a full request. */
|
|
411
421
|
amount: string;
|
|
412
422
|
/** Yieldseeker typed withdrawal fulfilled after an exactly verified fee
|
|
413
423
|
* deduction. Amount remains the confirmed net owner payout, and the gross
|
|
@@ -420,8 +430,9 @@ interface AgentWithdrawResult {
|
|
|
420
430
|
interface OwneyWithdrawResult {
|
|
421
431
|
agentResult: Record<AgentId, AgentWithdrawResult>;
|
|
422
432
|
/**
|
|
423
|
-
* Sum of
|
|
424
|
-
*
|
|
433
|
+
* Sum of confirmed smallest-unit amounts; null while any returned leg's
|
|
434
|
+
* payout is not yet known, including typed requests accepted asynchronously.
|
|
435
|
+
* Evidence-less custom adapters retain their confirmed-amount contract.
|
|
425
436
|
*/
|
|
426
437
|
totalWithdrawn: string | null;
|
|
427
438
|
}
|
|
@@ -704,6 +715,8 @@ declare class OwneySDK {
|
|
|
704
715
|
*/
|
|
705
716
|
private disabledAgents;
|
|
706
717
|
private state;
|
|
718
|
+
private connectionRevision;
|
|
719
|
+
private disconnectingAgents;
|
|
707
720
|
private apiKey;
|
|
708
721
|
private orgAgentConfig;
|
|
709
722
|
private orgAgentConfigPromise;
|
|
@@ -721,6 +734,7 @@ declare class OwneySDK {
|
|
|
721
734
|
private readonly recoveredFundingReads;
|
|
722
735
|
private fundingBalanceChecks;
|
|
723
736
|
private readonly activationChecks;
|
|
737
|
+
private readonly withdrawalSubmissions;
|
|
724
738
|
private readAgent;
|
|
725
739
|
private initializingAgentsPromise;
|
|
726
740
|
constructor(config: OwneySDKConfig);
|
|
@@ -735,6 +749,8 @@ declare class OwneySDK {
|
|
|
735
749
|
* After calling this, `connect()` must be called again before using agent methods.
|
|
736
750
|
*/
|
|
737
751
|
disconnect(): Promise<void>;
|
|
752
|
+
private clearConnectionState;
|
|
753
|
+
private disconnectAgents;
|
|
738
754
|
private isAgentDisabled;
|
|
739
755
|
/**
|
|
740
756
|
* Check if the SDK has an active connection state.
|
|
@@ -883,6 +899,7 @@ declare class OwneySDK {
|
|
|
883
899
|
inspectFunding(evidence: FundingEvidence, direction: "deposit" | "withdraw", options?: {
|
|
884
900
|
balanceRefreshUntil?: number;
|
|
885
901
|
refreshBalance?: boolean;
|
|
902
|
+
requireAmountMatch?: boolean;
|
|
886
903
|
}): Promise<FundingEvidence>;
|
|
887
904
|
/** Resolve a saved sponsored-withdrawal ID without opening a wallet prompt. */
|
|
888
905
|
resolveSponsoredWithdrawalEvidence(evidence: FundingEvidence, options?: {
|
|
@@ -1068,7 +1085,7 @@ type YieldseekerAgentOptions = {
|
|
|
1068
1085
|
/** Dedicated read transport; Base is used for receipt polling. */
|
|
1069
1086
|
rpcUrls?: RpcUrlsConfig;
|
|
1070
1087
|
/** Test seam for the wallet-submission/receipt boundary. */
|
|
1071
|
-
transactionExecutor?: (state: ConnectionState, chainId: number, transaction: YieldseekerTransaction) => Promise<Hex>;
|
|
1088
|
+
transactionExecutor?: (state: ConnectionState, chainId: number, transaction: YieldseekerTransaction, onReceipt?: (receipt: viem.TransactionReceipt) => void) => Promise<Hex>;
|
|
1072
1089
|
/** Test seam for transactions submitted outside transactionExecutor. */
|
|
1073
1090
|
unwindReceiptWaiter?: (state: ConnectionState, chainId: number, transactionHash: Hex) => Promise<void>;
|
|
1074
1091
|
};
|
|
@@ -1095,6 +1112,7 @@ declare class YieldseekerAgent implements IAgent {
|
|
|
1095
1112
|
private readonly routingApiBaseUrl?;
|
|
1096
1113
|
private receiptClient?;
|
|
1097
1114
|
private readonly withdrawalVersionCache;
|
|
1115
|
+
private readonly pendingUpgrades;
|
|
1098
1116
|
private readonly transactionExecutor?;
|
|
1099
1117
|
private readonly unwindReceiptWaiter?;
|
|
1100
1118
|
private readonly agentContexts;
|
|
@@ -1127,7 +1145,7 @@ declare class YieldseekerAgent implements IAgent {
|
|
|
1127
1145
|
}>;
|
|
1128
1146
|
disconnect(): Promise<void>;
|
|
1129
1147
|
activateAgent(state: ConnectionState, chainId: number, asset?: OwneySupportedTokens): Promise<void>;
|
|
1130
|
-
deposit(state: ConnectionState, chainId: number, amount: string, asset: OwneySupportedTokens, depositCallback?: DepositCallback, onProgress?: FundingProgress): Promise<OwneyDepositResult>;
|
|
1148
|
+
deposit(state: ConnectionState, chainId: number, amount: string, asset: OwneySupportedTokens, depositCallback?: DepositCallback, onProgress?: FundingProgress, onBeforeSubmission?: (evidence: FundingEvidence) => void | Promise<void>): Promise<OwneyDepositResult>;
|
|
1131
1149
|
withdraw(state: ConnectionState, chainId: number, asset: OwneySupportedTokens, amount?: string, onProgress?: FundingProgress, gasMode?: "auto" | "sponsored" | "paid", onBeforeSubmission?: FundingProgress): Promise<AgentWithdrawResult>;
|
|
1132
1150
|
private withdrawInternal;
|
|
1133
1151
|
/** A withdrawal-only liquidity floor; display snapshots never authorize it. */
|
|
@@ -1193,7 +1211,7 @@ declare class YieldseekerAgent implements IAgent {
|
|
|
1193
1211
|
private invalidResponse;
|
|
1194
1212
|
}
|
|
1195
1213
|
|
|
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";
|
|
1214
|
+
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_CHECKPOINT_FAILED" | "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
1215
|
declare class OwneyError extends Error {
|
|
1198
1216
|
readonly code: OwneyErrorCode;
|
|
1199
1217
|
readonly details?: Record<string, unknown>;
|