@owney/sdk 0.6.5-beta.0 → 0.6.5-beta.2

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
@@ -8,6 +8,13 @@ interface OwneySDKConfig {
8
8
  * Example: { 8453: "https://...", 42161: "https://..." }
9
9
  */
10
10
  zyfaiRpcUrls?: ZyfaiRpcUrlsConfig;
11
+ /**
12
+ * Optional override for the Owney routing API base URL used by the sponsored
13
+ * deposit callbacks (defaults to the OWNEY_ROUTING_API_BASE_URL env var, then
14
+ * the production URL). Set this to point at a local/staging routing API,
15
+ * e.g. "http://localhost:3000", when testing sponsor changes.
16
+ */
17
+ routingApiBaseUrl?: string;
11
18
  }
12
19
  interface ConnectionState {
13
20
  provider: any;
@@ -15,8 +22,8 @@ interface ConnectionState {
15
22
  chainId: number | null;
16
23
  }
17
24
  declare const SUPPORTED_TOKENS: readonly ["USDC", "USDT", "WETH"];
18
- declare const SUPPORTED_CHAIN_IDS: readonly [8453, 42161];
19
- declare const SUPPORTED_CHAINS: readonly ["BASE", "ARBITRUM"];
25
+ declare const SUPPORTED_CHAIN_IDS: readonly [8453, 42161, 1];
26
+ declare const SUPPORTED_CHAINS: readonly ["BASE", "ARBITRUM", "ETHEREUM"];
20
27
  type OwneySupportedChainId = (typeof SUPPORTED_CHAIN_IDS)[number];
21
28
  type OwneySupportedChains = (typeof SUPPORTED_CHAINS)[number];
22
29
  type OwneySupportedTokens = (typeof SUPPORTED_TOKENS)[number];
@@ -53,6 +60,14 @@ type WithdrawOptions = {
53
60
  type AccountApyOptions = {
54
61
  agentId?: AgentId;
55
62
  days: DailyApyDays;
63
+ /**
64
+ * Optional asset symbol (e.g. "USDC", "WETH") to scope the daily APY series
65
+ * to a specific asset on the active chain. Without it the series blends every
66
+ * position on the chain, so two assets sharing a chain (USDC and WETH on
67
+ * Base/Arbitrum) would render one merged line. Agents whose backends do not
68
+ * expose per-asset positions ignore this. (ROUT-186)
69
+ */
70
+ tokenSymbol?: string;
56
71
  };
57
72
  type AllocationApyOptions = {
58
73
  agentId?: AgentId;
@@ -257,7 +272,12 @@ interface IAgent {
257
272
  withdraw(state: ConnectionState, chainId: number, token: OwneySupportedTokens, amount?: string): Promise<AgentWithdrawResult>;
258
273
  getBalances(state: ConnectionState, chainId: number): Promise<AgentBalance>;
259
274
  getEarnings(state: ConnectionState, chainId: number): Promise<AgentEarnings>;
260
- getAccountApy(state: ConnectionState, chainId: number, days: DailyApyDays): Promise<AccountAgentApy>;
275
+ getAccountApy(state: ConnectionState, chainId: number, days: DailyApyDays,
276
+ /**
277
+ * Optional asset symbol ("USDC" / "WETH") scoping the daily series to a
278
+ * single asset on the chain. Agents without per-asset positions ignore it.
279
+ */
280
+ tokenSymbol?: string): Promise<AccountAgentApy>;
261
281
  getHistory(state: ConnectionState, chainId: number, options?: HistoryFilters): Promise<OwneyAgentHistory>;
262
282
  getUserProfile(state: ConnectionState, chainId: number): Promise<AgentUserProfile>;
263
283
  /**
@@ -292,6 +312,7 @@ declare class OwneySDK {
292
312
  private state;
293
313
  private apiKey;
294
314
  private zyfaiRpcUrls?;
315
+ private routingApiBaseUrl?;
295
316
  private cachedSponsoredCallback;
296
317
  private cachedWethSponsoredCallback;
297
318
  private initializingAgentsPromise;
@@ -431,7 +452,7 @@ declare class OwneySDK {
431
452
  * @param options.days - Lookback period: "7D", "14D", or "30D"
432
453
  * @returns {AccountAgentApy} for a single agent, or {OwneyAccountApy} with totalApy and per-agent breakdown
433
454
  */
434
- getAccountApy({ agentId, days, }: AccountApyOptions): Promise<OwneyAccountApy | AccountAgentApy>;
455
+ getAccountApy({ agentId, days, tokenSymbol, }: AccountApyOptions): Promise<OwneyAccountApy | AccountAgentApy>;
435
456
  /**
436
457
  * Get transaction history for a specific agent, or all agents.
437
458
  *
package/dist/index.d.ts CHANGED
@@ -8,6 +8,13 @@ interface OwneySDKConfig {
8
8
  * Example: { 8453: "https://...", 42161: "https://..." }
9
9
  */
10
10
  zyfaiRpcUrls?: ZyfaiRpcUrlsConfig;
11
+ /**
12
+ * Optional override for the Owney routing API base URL used by the sponsored
13
+ * deposit callbacks (defaults to the OWNEY_ROUTING_API_BASE_URL env var, then
14
+ * the production URL). Set this to point at a local/staging routing API,
15
+ * e.g. "http://localhost:3000", when testing sponsor changes.
16
+ */
17
+ routingApiBaseUrl?: string;
11
18
  }
12
19
  interface ConnectionState {
13
20
  provider: any;
@@ -15,8 +22,8 @@ interface ConnectionState {
15
22
  chainId: number | null;
16
23
  }
17
24
  declare const SUPPORTED_TOKENS: readonly ["USDC", "USDT", "WETH"];
18
- declare const SUPPORTED_CHAIN_IDS: readonly [8453, 42161];
19
- declare const SUPPORTED_CHAINS: readonly ["BASE", "ARBITRUM"];
25
+ declare const SUPPORTED_CHAIN_IDS: readonly [8453, 42161, 1];
26
+ declare const SUPPORTED_CHAINS: readonly ["BASE", "ARBITRUM", "ETHEREUM"];
20
27
  type OwneySupportedChainId = (typeof SUPPORTED_CHAIN_IDS)[number];
21
28
  type OwneySupportedChains = (typeof SUPPORTED_CHAINS)[number];
22
29
  type OwneySupportedTokens = (typeof SUPPORTED_TOKENS)[number];
@@ -53,6 +60,14 @@ type WithdrawOptions = {
53
60
  type AccountApyOptions = {
54
61
  agentId?: AgentId;
55
62
  days: DailyApyDays;
63
+ /**
64
+ * Optional asset symbol (e.g. "USDC", "WETH") to scope the daily APY series
65
+ * to a specific asset on the active chain. Without it the series blends every
66
+ * position on the chain, so two assets sharing a chain (USDC and WETH on
67
+ * Base/Arbitrum) would render one merged line. Agents whose backends do not
68
+ * expose per-asset positions ignore this. (ROUT-186)
69
+ */
70
+ tokenSymbol?: string;
56
71
  };
57
72
  type AllocationApyOptions = {
58
73
  agentId?: AgentId;
@@ -257,7 +272,12 @@ interface IAgent {
257
272
  withdraw(state: ConnectionState, chainId: number, token: OwneySupportedTokens, amount?: string): Promise<AgentWithdrawResult>;
258
273
  getBalances(state: ConnectionState, chainId: number): Promise<AgentBalance>;
259
274
  getEarnings(state: ConnectionState, chainId: number): Promise<AgentEarnings>;
260
- getAccountApy(state: ConnectionState, chainId: number, days: DailyApyDays): Promise<AccountAgentApy>;
275
+ getAccountApy(state: ConnectionState, chainId: number, days: DailyApyDays,
276
+ /**
277
+ * Optional asset symbol ("USDC" / "WETH") scoping the daily series to a
278
+ * single asset on the chain. Agents without per-asset positions ignore it.
279
+ */
280
+ tokenSymbol?: string): Promise<AccountAgentApy>;
261
281
  getHistory(state: ConnectionState, chainId: number, options?: HistoryFilters): Promise<OwneyAgentHistory>;
262
282
  getUserProfile(state: ConnectionState, chainId: number): Promise<AgentUserProfile>;
263
283
  /**
@@ -292,6 +312,7 @@ declare class OwneySDK {
292
312
  private state;
293
313
  private apiKey;
294
314
  private zyfaiRpcUrls?;
315
+ private routingApiBaseUrl?;
295
316
  private cachedSponsoredCallback;
296
317
  private cachedWethSponsoredCallback;
297
318
  private initializingAgentsPromise;
@@ -431,7 +452,7 @@ declare class OwneySDK {
431
452
  * @param options.days - Lookback period: "7D", "14D", or "30D"
432
453
  * @returns {AccountAgentApy} for a single agent, or {OwneyAccountApy} with totalApy and per-agent breakdown
433
454
  */
434
- getAccountApy({ agentId, days, }: AccountApyOptions): Promise<OwneyAccountApy | AccountAgentApy>;
455
+ getAccountApy({ agentId, days, tokenSymbol, }: AccountApyOptions): Promise<OwneyAccountApy | AccountAgentApy>;
435
456
  /**
436
457
  * Get transaction history for a specific agent, or all agents.
437
458
  *