@owney/sdk 0.7.25-beta.19 → 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.d.cts CHANGED
@@ -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 is confirmed, but clearing all MAX positions still needs verification. */
412
+ /** Owner payout or clearing all MAX positions still needs verification. */
409
413
  completion?: "unverified";
410
- /** Smallest-unit amount, or a provider sentinel such as "all" for a full request. */
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 reported smallest-unit amounts; null when a full withdrawal's
424
- * amount is not yet known. An accepted request is not proof of settlement.
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
  }
@@ -704,6 +710,8 @@ declare class OwneySDK {
704
710
  */
705
711
  private disabledAgents;
706
712
  private state;
713
+ private connectionRevision;
714
+ private disconnectingAgents;
707
715
  private apiKey;
708
716
  private orgAgentConfig;
709
717
  private orgAgentConfigPromise;
@@ -721,6 +729,7 @@ declare class OwneySDK {
721
729
  private readonly recoveredFundingReads;
722
730
  private fundingBalanceChecks;
723
731
  private readonly activationChecks;
732
+ private readonly withdrawalSubmissions;
724
733
  private readAgent;
725
734
  private initializingAgentsPromise;
726
735
  constructor(config: OwneySDKConfig);
@@ -735,6 +744,8 @@ declare class OwneySDK {
735
744
  * After calling this, `connect()` must be called again before using agent methods.
736
745
  */
737
746
  disconnect(): Promise<void>;
747
+ private clearConnectionState;
748
+ private disconnectAgents;
738
749
  private isAgentDisabled;
739
750
  /**
740
751
  * Check if the SDK has an active connection state.
@@ -883,6 +894,7 @@ declare class OwneySDK {
883
894
  inspectFunding(evidence: FundingEvidence, direction: "deposit" | "withdraw", options?: {
884
895
  balanceRefreshUntil?: number;
885
896
  refreshBalance?: boolean;
897
+ requireAmountMatch?: boolean;
886
898
  }): Promise<FundingEvidence>;
887
899
  /** Resolve a saved sponsored-withdrawal ID without opening a wallet prompt. */
888
900
  resolveSponsoredWithdrawalEvidence(evidence: FundingEvidence, options?: {
@@ -1068,7 +1080,7 @@ type YieldseekerAgentOptions = {
1068
1080
  /** Dedicated read transport; Base is used for receipt polling. */
1069
1081
  rpcUrls?: RpcUrlsConfig;
1070
1082
  /** Test seam for the wallet-submission/receipt boundary. */
1071
- transactionExecutor?: (state: ConnectionState, chainId: number, transaction: YieldseekerTransaction) => Promise<Hex>;
1083
+ transactionExecutor?: (state: ConnectionState, chainId: number, transaction: YieldseekerTransaction, onReceipt?: (receipt: viem.TransactionReceipt) => void) => Promise<Hex>;
1072
1084
  /** Test seam for transactions submitted outside transactionExecutor. */
1073
1085
  unwindReceiptWaiter?: (state: ConnectionState, chainId: number, transactionHash: Hex) => Promise<void>;
1074
1086
  };
@@ -1095,6 +1107,7 @@ declare class YieldseekerAgent implements IAgent {
1095
1107
  private readonly routingApiBaseUrl?;
1096
1108
  private receiptClient?;
1097
1109
  private readonly withdrawalVersionCache;
1110
+ private readonly pendingUpgrades;
1098
1111
  private readonly transactionExecutor?;
1099
1112
  private readonly unwindReceiptWaiter?;
1100
1113
  private readonly agentContexts;
@@ -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
@@ -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 is confirmed, but clearing all MAX positions still needs verification. */
412
+ /** Owner payout or clearing all MAX positions still needs verification. */
409
413
  completion?: "unverified";
410
- /** Smallest-unit amount, or a provider sentinel such as "all" for a full request. */
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 reported smallest-unit amounts; null when a full withdrawal's
424
- * amount is not yet known. An accepted request is not proof of settlement.
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
  }
@@ -704,6 +710,8 @@ declare class OwneySDK {
704
710
  */
705
711
  private disabledAgents;
706
712
  private state;
713
+ private connectionRevision;
714
+ private disconnectingAgents;
707
715
  private apiKey;
708
716
  private orgAgentConfig;
709
717
  private orgAgentConfigPromise;
@@ -721,6 +729,7 @@ declare class OwneySDK {
721
729
  private readonly recoveredFundingReads;
722
730
  private fundingBalanceChecks;
723
731
  private readonly activationChecks;
732
+ private readonly withdrawalSubmissions;
724
733
  private readAgent;
725
734
  private initializingAgentsPromise;
726
735
  constructor(config: OwneySDKConfig);
@@ -735,6 +744,8 @@ declare class OwneySDK {
735
744
  * After calling this, `connect()` must be called again before using agent methods.
736
745
  */
737
746
  disconnect(): Promise<void>;
747
+ private clearConnectionState;
748
+ private disconnectAgents;
738
749
  private isAgentDisabled;
739
750
  /**
740
751
  * Check if the SDK has an active connection state.
@@ -883,6 +894,7 @@ declare class OwneySDK {
883
894
  inspectFunding(evidence: FundingEvidence, direction: "deposit" | "withdraw", options?: {
884
895
  balanceRefreshUntil?: number;
885
896
  refreshBalance?: boolean;
897
+ requireAmountMatch?: boolean;
886
898
  }): Promise<FundingEvidence>;
887
899
  /** Resolve a saved sponsored-withdrawal ID without opening a wallet prompt. */
888
900
  resolveSponsoredWithdrawalEvidence(evidence: FundingEvidence, options?: {
@@ -1068,7 +1080,7 @@ type YieldseekerAgentOptions = {
1068
1080
  /** Dedicated read transport; Base is used for receipt polling. */
1069
1081
  rpcUrls?: RpcUrlsConfig;
1070
1082
  /** Test seam for the wallet-submission/receipt boundary. */
1071
- transactionExecutor?: (state: ConnectionState, chainId: number, transaction: YieldseekerTransaction) => Promise<Hex>;
1083
+ transactionExecutor?: (state: ConnectionState, chainId: number, transaction: YieldseekerTransaction, onReceipt?: (receipt: viem.TransactionReceipt) => void) => Promise<Hex>;
1072
1084
  /** Test seam for transactions submitted outside transactionExecutor. */
1073
1085
  unwindReceiptWaiter?: (state: ConnectionState, chainId: number, transactionHash: Hex) => Promise<void>;
1074
1086
  };
@@ -1095,6 +1107,7 @@ declare class YieldseekerAgent implements IAgent {
1095
1107
  private readonly routingApiBaseUrl?;
1096
1108
  private receiptClient?;
1097
1109
  private readonly withdrawalVersionCache;
1110
+ private readonly pendingUpgrades;
1098
1111
  private readonly transactionExecutor?;
1099
1112
  private readonly unwindReceiptWaiter?;
1100
1113
  private readonly agentContexts;
@@ -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>;