@owney/sdk 0.7.25-beta.0 → 0.7.25-beta.1
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/README.md +9 -7
- package/dist/index.cjs +2454 -1434
- package/dist/index.d.cts +144 -350
- package/dist/index.d.ts +144 -350
- package/dist/index.js +2470 -1434
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ const sdk = new OwneySDK({ apiKey: "your-owney-api-key" });
|
|
|
19
19
|
// Connect with an EIP-1193 wallet provider
|
|
20
20
|
await sdk.connect(provider);
|
|
21
21
|
|
|
22
|
-
// Activate agents on Base (
|
|
22
|
+
// Activate agents on Base (creates and initializes provider wallets as needed)
|
|
23
23
|
await sdk.activateAgent(8453);
|
|
24
24
|
|
|
25
25
|
// Get balances across all agents
|
|
@@ -32,10 +32,10 @@ const balances = await sdk.getBalances();
|
|
|
32
32
|
|
|
33
33
|
Create a new SDK instance.
|
|
34
34
|
|
|
35
|
-
| Param
|
|
36
|
-
|
|
|
37
|
-
| `config.apiKey`
|
|
38
|
-
| `config.zyfaiRpcUrls`
|
|
35
|
+
| Param | Type | Description |
|
|
36
|
+
| --------------------------------------- | ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
|
|
37
|
+
| `config.apiKey` | `string` | Your Owney API key, used to authenticate with the routing API and fetch agent-specific keys |
|
|
38
|
+
| `config.zyfaiRpcUrls` | `{ 8453?: string; 42161?: string }` (optional) | Per-chain RPC URL overrides used by Zyfai SDK network calls |
|
|
39
39
|
|
|
40
40
|
```typescript
|
|
41
41
|
import { OwneySDK } from "@owney/sdk";
|
|
@@ -108,7 +108,7 @@ if (chainId) {
|
|
|
108
108
|
|
|
109
109
|
### `activateAgent(chainId, agentId?)`
|
|
110
110
|
|
|
111
|
-
Activate the user's smart wallet for the specified agents, or all chain-compatible agents if omitted.
|
|
111
|
+
Activate the user's smart wallet for the specified agents, or all chain-compatible agents if omitted. Activation performs each provider's required setup before deposits are allowed. For Yieldseeker, this creates the user and agent when needed and calls the agent `/deploy` endpoint before any funding transfer. Saves the chainId for use by all subsequent SDK calls.
|
|
112
112
|
|
|
113
113
|
| Param | Type | Description |
|
|
114
114
|
| --------- | ---------------------- | ----------------------------------------------------------------------------- |
|
|
@@ -125,7 +125,7 @@ await sdk.activateAgent(42161);
|
|
|
125
125
|
|
|
126
126
|
### `deposit(options)`
|
|
127
127
|
|
|
128
|
-
Deposit funds into a specific agent, or split equally across all agents if `agentId` is omitted. Validates that the asset is supported by the target agent(s) on the active chain, and per-agent minimum deposit amounts (defined per chain+asset on `agent.supportedAssets[].assets[].minDepositAmount`) are taken into account.
|
|
128
|
+
Deposit funds into a specific agent, or split equally across all agents if `agentId` is omitted. Validates that the asset is supported by the target agent(s) on the active chain, and per-agent minimum deposit amounts (defined per chain+asset on `agent.supportedAssets[].assets[].minDepositAmount`) are taken into account. Custom `depositCallback` implementations run once per final valid agent. The default Permit2 flow signs one recipient-bound batch authorization for every agent share.
|
|
129
129
|
|
|
130
130
|
| Param | Type | Description |
|
|
131
131
|
| ------------------------- | -------------------- | --------------------------------------------------------------- |
|
|
@@ -572,12 +572,14 @@ interface AccountAgentApy {
|
|
|
572
572
|
weightedApyAfterFee?: number;
|
|
573
573
|
weightedApyAfterFeeDetails?: AgentApyDetails;
|
|
574
574
|
apyByChainAndAsset?: ApyByChainAndAsset;
|
|
575
|
+
history?: ApyHistoryPoint[];
|
|
575
576
|
}
|
|
576
577
|
|
|
577
578
|
interface OwneyAccountApy {
|
|
578
579
|
totalApy: string;
|
|
579
580
|
agentApy: Record<AgentId, AccountAgentApy>;
|
|
580
581
|
apyByChainAndAsset: ApyByChainAndAsset;
|
|
582
|
+
history?: ApyHistoryPoint[]; // balance-weighted aggregate daily series
|
|
581
583
|
}
|
|
582
584
|
|
|
583
585
|
type HistoryAction = "Rebalance" | "Deposit" | "Top up" | "Withdraw" | "Earned";
|