@owney/sdk 0.7.25-beta.15 → 0.7.25-beta.16
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 +556 -110
- package/dist/index.d.cts +24 -1
- package/dist/index.d.ts +24 -1
- package/dist/index.js +557 -110
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -145,6 +145,11 @@ interface IAgent {
|
|
|
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
|
+
/** Read-only chain proof when indexed withdrawal components are incomplete.
|
|
149
|
+
* Returns raw owner-withdrawable units; unavailable proof must throw.
|
|
150
|
+
* minimumAmount is the raw liquidity required from this agent for a typed
|
|
151
|
+
* plan, so adapters can expand discovery when known positions fall short. */
|
|
152
|
+
getWithdrawableBalance?(state: ConnectionState, chainId: number, asset: OwneySupportedTokens, minimumAmount?: bigint): Promise<bigint>;
|
|
148
153
|
/** Optional positive proof for a repeat deposit; unknown must fall back to portfolio validation. */
|
|
149
154
|
hasExistingDepositFunds?(state: ConnectionState, chainId: number, asset: OwneySupportedTokens): Promise<true | undefined>;
|
|
150
155
|
getBalances(state: ConnectionState, chainId: number, asset?: OwneySupportedTokens): Promise<AgentBalance>;
|
|
@@ -355,7 +360,9 @@ interface FundingEvidence {
|
|
|
355
360
|
method?: "GET" | "POST";
|
|
356
361
|
path?: "/users/withdraw" | "/users/partial-withdraw";
|
|
357
362
|
elapsedMs?: number;
|
|
358
|
-
|
|
363
|
+
/** Actual response status captured before the vendor replaces the HTTP error. */
|
|
364
|
+
httpStatus?: number;
|
|
365
|
+
failure?: "network" | "unauthorized" | "forbidden" | "rate-limited" | "insufficient-balance" | "session-key-missing" | "withdrawal-in-progress" | "other";
|
|
359
366
|
};
|
|
360
367
|
transfer: FundingStage;
|
|
361
368
|
registration: FundingStage;
|
|
@@ -393,6 +400,13 @@ interface AgentWithdrawResult {
|
|
|
393
400
|
completion?: "unverified";
|
|
394
401
|
/** Smallest-unit amount, or a provider sentinel such as "all" for a full request. */
|
|
395
402
|
amount: string;
|
|
403
|
+
/** Yieldseeker typed withdrawal fulfilled after an exactly verified fee
|
|
404
|
+
* deduction. Amount remains the confirmed net owner payout, and the gross
|
|
405
|
+
* amount must equal that payout plus the fee, all in token base units. */
|
|
406
|
+
feeAdjustment?: {
|
|
407
|
+
grossAmount: string;
|
|
408
|
+
feeAmount: string;
|
|
409
|
+
};
|
|
396
410
|
}
|
|
397
411
|
interface OwneyWithdrawResult {
|
|
398
412
|
agentResult: Record<AgentId, AgentWithdrawResult>;
|
|
@@ -904,6 +918,8 @@ declare class OwneySDK {
|
|
|
904
918
|
chainId?: number;
|
|
905
919
|
asset?: OwneySupportedTokens;
|
|
906
920
|
}): Promise<OwneyBalances | AgentBalance>;
|
|
921
|
+
/** Preserve failure objects for withdrawal recovery without changing public balance results. */
|
|
922
|
+
private readAggregatedBalances;
|
|
907
923
|
/**
|
|
908
924
|
* Get the user's on-chain earnings for a specific agent, or aggregated across all agents.
|
|
909
925
|
* @param agentId - Optional. Agent to query. Omit for aggregated earnings.
|
|
@@ -1100,6 +1116,13 @@ declare class YieldseekerAgent implements IAgent {
|
|
|
1100
1116
|
deposit(state: ConnectionState, chainId: number, amount: string, asset: OwneySupportedTokens, depositCallback?: DepositCallback, onProgress?: FundingProgress): Promise<OwneyDepositResult>;
|
|
1101
1117
|
withdraw(state: ConnectionState, chainId: number, asset: OwneySupportedTokens, amount?: string, onProgress?: FundingProgress, gasMode?: "auto" | "sponsored" | "paid", onBeforeSubmission?: FundingProgress): Promise<AgentWithdrawResult>;
|
|
1102
1118
|
private withdrawInternal;
|
|
1119
|
+
/** A withdrawal-only liquidity floor; display snapshots never authorize it. */
|
|
1120
|
+
getWithdrawableBalance(state: ConnectionState, chainId: number, asset: OwneySupportedTokens, minimumAmount?: bigint): Promise<bigint>;
|
|
1121
|
+
private readVaultLiquidity;
|
|
1122
|
+
private validateWithdrawalPositions;
|
|
1123
|
+
private withdrawalVaultHints;
|
|
1124
|
+
private readWithdrawalPositions;
|
|
1125
|
+
private resolveWithdrawalLiquidity;
|
|
1103
1126
|
getBalances(state: ConnectionState, chainId: number, asset?: OwneySupportedTokens): Promise<AgentBalance>;
|
|
1104
1127
|
invalidateFundingRead(state: ConnectionState, chainId: number, asset: OwneySupportedTokens, refreshUntil?: number): void;
|
|
1105
1128
|
endFundingBalanceRefresh(state: ConnectionState, chainId: number, asset: OwneySupportedTokens, read: AssetReadMetadata): boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -145,6 +145,11 @@ interface IAgent {
|
|
|
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
|
+
/** Read-only chain proof when indexed withdrawal components are incomplete.
|
|
149
|
+
* Returns raw owner-withdrawable units; unavailable proof must throw.
|
|
150
|
+
* minimumAmount is the raw liquidity required from this agent for a typed
|
|
151
|
+
* plan, so adapters can expand discovery when known positions fall short. */
|
|
152
|
+
getWithdrawableBalance?(state: ConnectionState, chainId: number, asset: OwneySupportedTokens, minimumAmount?: bigint): Promise<bigint>;
|
|
148
153
|
/** Optional positive proof for a repeat deposit; unknown must fall back to portfolio validation. */
|
|
149
154
|
hasExistingDepositFunds?(state: ConnectionState, chainId: number, asset: OwneySupportedTokens): Promise<true | undefined>;
|
|
150
155
|
getBalances(state: ConnectionState, chainId: number, asset?: OwneySupportedTokens): Promise<AgentBalance>;
|
|
@@ -355,7 +360,9 @@ interface FundingEvidence {
|
|
|
355
360
|
method?: "GET" | "POST";
|
|
356
361
|
path?: "/users/withdraw" | "/users/partial-withdraw";
|
|
357
362
|
elapsedMs?: number;
|
|
358
|
-
|
|
363
|
+
/** Actual response status captured before the vendor replaces the HTTP error. */
|
|
364
|
+
httpStatus?: number;
|
|
365
|
+
failure?: "network" | "unauthorized" | "forbidden" | "rate-limited" | "insufficient-balance" | "session-key-missing" | "withdrawal-in-progress" | "other";
|
|
359
366
|
};
|
|
360
367
|
transfer: FundingStage;
|
|
361
368
|
registration: FundingStage;
|
|
@@ -393,6 +400,13 @@ interface AgentWithdrawResult {
|
|
|
393
400
|
completion?: "unverified";
|
|
394
401
|
/** Smallest-unit amount, or a provider sentinel such as "all" for a full request. */
|
|
395
402
|
amount: string;
|
|
403
|
+
/** Yieldseeker typed withdrawal fulfilled after an exactly verified fee
|
|
404
|
+
* deduction. Amount remains the confirmed net owner payout, and the gross
|
|
405
|
+
* amount must equal that payout plus the fee, all in token base units. */
|
|
406
|
+
feeAdjustment?: {
|
|
407
|
+
grossAmount: string;
|
|
408
|
+
feeAmount: string;
|
|
409
|
+
};
|
|
396
410
|
}
|
|
397
411
|
interface OwneyWithdrawResult {
|
|
398
412
|
agentResult: Record<AgentId, AgentWithdrawResult>;
|
|
@@ -904,6 +918,8 @@ declare class OwneySDK {
|
|
|
904
918
|
chainId?: number;
|
|
905
919
|
asset?: OwneySupportedTokens;
|
|
906
920
|
}): Promise<OwneyBalances | AgentBalance>;
|
|
921
|
+
/** Preserve failure objects for withdrawal recovery without changing public balance results. */
|
|
922
|
+
private readAggregatedBalances;
|
|
907
923
|
/**
|
|
908
924
|
* Get the user's on-chain earnings for a specific agent, or aggregated across all agents.
|
|
909
925
|
* @param agentId - Optional. Agent to query. Omit for aggregated earnings.
|
|
@@ -1100,6 +1116,13 @@ declare class YieldseekerAgent implements IAgent {
|
|
|
1100
1116
|
deposit(state: ConnectionState, chainId: number, amount: string, asset: OwneySupportedTokens, depositCallback?: DepositCallback, onProgress?: FundingProgress): Promise<OwneyDepositResult>;
|
|
1101
1117
|
withdraw(state: ConnectionState, chainId: number, asset: OwneySupportedTokens, amount?: string, onProgress?: FundingProgress, gasMode?: "auto" | "sponsored" | "paid", onBeforeSubmission?: FundingProgress): Promise<AgentWithdrawResult>;
|
|
1102
1118
|
private withdrawInternal;
|
|
1119
|
+
/** A withdrawal-only liquidity floor; display snapshots never authorize it. */
|
|
1120
|
+
getWithdrawableBalance(state: ConnectionState, chainId: number, asset: OwneySupportedTokens, minimumAmount?: bigint): Promise<bigint>;
|
|
1121
|
+
private readVaultLiquidity;
|
|
1122
|
+
private validateWithdrawalPositions;
|
|
1123
|
+
private withdrawalVaultHints;
|
|
1124
|
+
private readWithdrawalPositions;
|
|
1125
|
+
private resolveWithdrawalLiquidity;
|
|
1103
1126
|
getBalances(state: ConnectionState, chainId: number, asset?: OwneySupportedTokens): Promise<AgentBalance>;
|
|
1104
1127
|
invalidateFundingRead(state: ConnectionState, chainId: number, asset: OwneySupportedTokens, refreshUntil?: number): void;
|
|
1105
1128
|
endFundingBalanceRefresh(state: ConnectionState, chainId: number, asset: OwneySupportedTokens, read: AssetReadMetadata): boolean;
|