@owney/sdk 0.6.0 → 0.6.1-beta.0
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 +6 -1
- package/dist/index.d.cts +13 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +6 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -264,10 +264,15 @@ function mapWeightedApyByChain(raw) {
|
|
|
264
264
|
return Object.keys(out).length > 0 ? out : void 0;
|
|
265
265
|
}
|
|
266
266
|
function mapApyHistory(raw) {
|
|
267
|
+
const history = Object.entries(raw.history ?? {}).map(([date, entry]) => ({
|
|
268
|
+
date,
|
|
269
|
+
apy: sumTokenValues(entry.weighted_apy_after_fee)
|
|
270
|
+
})).sort((a, b) => a.date.localeCompare(b.date));
|
|
267
271
|
return {
|
|
268
272
|
walletAddress: raw.walletAddress,
|
|
269
273
|
weightedApyAfterFee: raw.weightedApyAfterFee ? sumTokenValues(raw.weightedApyAfterFee) : void 0,
|
|
270
|
-
apyByChainAndAsset: mapWeightedApyByChain(raw.weightedApyAfterFeeByChain)
|
|
274
|
+
apyByChainAndAsset: mapWeightedApyByChain(raw.weightedApyAfterFeeByChain),
|
|
275
|
+
history
|
|
271
276
|
};
|
|
272
277
|
}
|
|
273
278
|
function splitOpportunity(opportunity) {
|
package/dist/index.d.cts
CHANGED
|
@@ -82,11 +82,23 @@ interface OwneyEarnings {
|
|
|
82
82
|
agentEarnings: Record<AgentId, AgentEarnings>;
|
|
83
83
|
}
|
|
84
84
|
type ApyByChainAndAsset = Partial<Record<OwneySupportedChainId, Partial<Record<OwneySupportedTokens, number>>>>;
|
|
85
|
+
/** A single day's net APY for the connected account, as a percentage number. */
|
|
86
|
+
interface ApyHistoryPoint {
|
|
87
|
+
/** ISO date string for the day, e.g. "2026-06-20". */
|
|
88
|
+
date: string;
|
|
89
|
+
/** Net (after-fee) weighted APY for that day, summed across tokens. */
|
|
90
|
+
apy: number;
|
|
91
|
+
}
|
|
85
92
|
interface AccountAgentApy {
|
|
86
93
|
walletAddress: string;
|
|
87
94
|
weightedApyAfterFee?: number;
|
|
88
95
|
weightedApyAfterFeeDetails?: AgentApyDetails;
|
|
89
96
|
apyByChainAndAsset?: ApyByChainAndAsset;
|
|
97
|
+
/**
|
|
98
|
+
* Daily net-APY series for the requested window (7D/14D/30D), ascending by
|
|
99
|
+
* date. Empty when the provider returns no daily history.
|
|
100
|
+
*/
|
|
101
|
+
history?: ApyHistoryPoint[];
|
|
90
102
|
}
|
|
91
103
|
interface OwneyAccountApy {
|
|
92
104
|
totalApy: string;
|
|
@@ -464,4 +476,4 @@ type OwneySIWXConfig = {
|
|
|
464
476
|
*/
|
|
465
477
|
declare function createOwneySIWX(config: OwneySIWXConfig): SIWXConfig;
|
|
466
478
|
|
|
467
|
-
export { AccountAgentApy, AccountApyOptions, AgentApy, AgentApyDetails, AgentBalance, AgentChainIncompatibleError, AgentEarnings, AgentHistoryEntry, AgentHistoryPosition, AgentId, AgentNotFoundError, AgentSupportedAsset, AgentSupportedAssets, AgentUserProfile, AgentWithdrawResult, AgentsApyOptions, AllocationAgentApy, ApyByChainAndAsset, Asset, ConnectionState, DailyApyDays, DepositCallback, DepositOptions, HistoryAction, HistoryFilters, HistoryOptions, HistoryTransaction, IAgent, InvalidHistoryCursorError, NotConnectedError, OwneyAccountApy, OwneyAgentApy, OwneyAgentHistory, OwneyAllocationApy, OwneyBalances, OwneyDepositResult, OwneyEarnings, OwneyError, OwneyErrorCode, OwneyMultiDepositResult, OwneyPosition, OwneySDK, OwneySDKConfig, OwneySIWXConfig, OwneySupportedChainId, OwneySupportedChains, OwneySupportedTokens, OwneyToken, OwneyUserProfile, OwneyWithdrawResult, RebalanceLog, WithdrawOptions, createOwneySIWX };
|
|
479
|
+
export { AccountAgentApy, AccountApyOptions, AgentApy, AgentApyDetails, AgentBalance, AgentChainIncompatibleError, AgentEarnings, AgentHistoryEntry, AgentHistoryPosition, AgentId, AgentNotFoundError, AgentSupportedAsset, AgentSupportedAssets, AgentUserProfile, AgentWithdrawResult, AgentsApyOptions, AllocationAgentApy, ApyByChainAndAsset, ApyHistoryPoint, Asset, ConnectionState, DailyApyDays, DepositCallback, DepositOptions, HistoryAction, HistoryFilters, HistoryOptions, HistoryTransaction, IAgent, InvalidHistoryCursorError, NotConnectedError, OwneyAccountApy, OwneyAgentApy, OwneyAgentHistory, OwneyAllocationApy, OwneyBalances, OwneyDepositResult, OwneyEarnings, OwneyError, OwneyErrorCode, OwneyMultiDepositResult, OwneyPosition, OwneySDK, OwneySDKConfig, OwneySIWXConfig, OwneySupportedChainId, OwneySupportedChains, OwneySupportedTokens, OwneyToken, OwneyUserProfile, OwneyWithdrawResult, RebalanceLog, WithdrawOptions, createOwneySIWX };
|
package/dist/index.d.ts
CHANGED
|
@@ -82,11 +82,23 @@ interface OwneyEarnings {
|
|
|
82
82
|
agentEarnings: Record<AgentId, AgentEarnings>;
|
|
83
83
|
}
|
|
84
84
|
type ApyByChainAndAsset = Partial<Record<OwneySupportedChainId, Partial<Record<OwneySupportedTokens, number>>>>;
|
|
85
|
+
/** A single day's net APY for the connected account, as a percentage number. */
|
|
86
|
+
interface ApyHistoryPoint {
|
|
87
|
+
/** ISO date string for the day, e.g. "2026-06-20". */
|
|
88
|
+
date: string;
|
|
89
|
+
/** Net (after-fee) weighted APY for that day, summed across tokens. */
|
|
90
|
+
apy: number;
|
|
91
|
+
}
|
|
85
92
|
interface AccountAgentApy {
|
|
86
93
|
walletAddress: string;
|
|
87
94
|
weightedApyAfterFee?: number;
|
|
88
95
|
weightedApyAfterFeeDetails?: AgentApyDetails;
|
|
89
96
|
apyByChainAndAsset?: ApyByChainAndAsset;
|
|
97
|
+
/**
|
|
98
|
+
* Daily net-APY series for the requested window (7D/14D/30D), ascending by
|
|
99
|
+
* date. Empty when the provider returns no daily history.
|
|
100
|
+
*/
|
|
101
|
+
history?: ApyHistoryPoint[];
|
|
90
102
|
}
|
|
91
103
|
interface OwneyAccountApy {
|
|
92
104
|
totalApy: string;
|
|
@@ -464,4 +476,4 @@ type OwneySIWXConfig = {
|
|
|
464
476
|
*/
|
|
465
477
|
declare function createOwneySIWX(config: OwneySIWXConfig): SIWXConfig;
|
|
466
478
|
|
|
467
|
-
export { AccountAgentApy, AccountApyOptions, AgentApy, AgentApyDetails, AgentBalance, AgentChainIncompatibleError, AgentEarnings, AgentHistoryEntry, AgentHistoryPosition, AgentId, AgentNotFoundError, AgentSupportedAsset, AgentSupportedAssets, AgentUserProfile, AgentWithdrawResult, AgentsApyOptions, AllocationAgentApy, ApyByChainAndAsset, Asset, ConnectionState, DailyApyDays, DepositCallback, DepositOptions, HistoryAction, HistoryFilters, HistoryOptions, HistoryTransaction, IAgent, InvalidHistoryCursorError, NotConnectedError, OwneyAccountApy, OwneyAgentApy, OwneyAgentHistory, OwneyAllocationApy, OwneyBalances, OwneyDepositResult, OwneyEarnings, OwneyError, OwneyErrorCode, OwneyMultiDepositResult, OwneyPosition, OwneySDK, OwneySDKConfig, OwneySIWXConfig, OwneySupportedChainId, OwneySupportedChains, OwneySupportedTokens, OwneyToken, OwneyUserProfile, OwneyWithdrawResult, RebalanceLog, WithdrawOptions, createOwneySIWX };
|
|
479
|
+
export { AccountAgentApy, AccountApyOptions, AgentApy, AgentApyDetails, AgentBalance, AgentChainIncompatibleError, AgentEarnings, AgentHistoryEntry, AgentHistoryPosition, AgentId, AgentNotFoundError, AgentSupportedAsset, AgentSupportedAssets, AgentUserProfile, AgentWithdrawResult, AgentsApyOptions, AllocationAgentApy, ApyByChainAndAsset, ApyHistoryPoint, Asset, ConnectionState, DailyApyDays, DepositCallback, DepositOptions, HistoryAction, HistoryFilters, HistoryOptions, HistoryTransaction, IAgent, InvalidHistoryCursorError, NotConnectedError, OwneyAccountApy, OwneyAgentApy, OwneyAgentHistory, OwneyAllocationApy, OwneyBalances, OwneyDepositResult, OwneyEarnings, OwneyError, OwneyErrorCode, OwneyMultiDepositResult, OwneyPosition, OwneySDK, OwneySDKConfig, OwneySIWXConfig, OwneySupportedChainId, OwneySupportedChains, OwneySupportedTokens, OwneyToken, OwneyUserProfile, OwneyWithdrawResult, RebalanceLog, WithdrawOptions, createOwneySIWX };
|
package/dist/index.js
CHANGED
|
@@ -232,10 +232,15 @@ function mapWeightedApyByChain(raw) {
|
|
|
232
232
|
return Object.keys(out).length > 0 ? out : void 0;
|
|
233
233
|
}
|
|
234
234
|
function mapApyHistory(raw) {
|
|
235
|
+
const history = Object.entries(raw.history ?? {}).map(([date, entry]) => ({
|
|
236
|
+
date,
|
|
237
|
+
apy: sumTokenValues(entry.weighted_apy_after_fee)
|
|
238
|
+
})).sort((a, b) => a.date.localeCompare(b.date));
|
|
235
239
|
return {
|
|
236
240
|
walletAddress: raw.walletAddress,
|
|
237
241
|
weightedApyAfterFee: raw.weightedApyAfterFee ? sumTokenValues(raw.weightedApyAfterFee) : void 0,
|
|
238
|
-
apyByChainAndAsset: mapWeightedApyByChain(raw.weightedApyAfterFeeByChain)
|
|
242
|
+
apyByChainAndAsset: mapWeightedApyByChain(raw.weightedApyAfterFeeByChain),
|
|
243
|
+
history
|
|
239
244
|
};
|
|
240
245
|
}
|
|
241
246
|
function splitOpportunity(opportunity) {
|