@owney/sdk 0.6.9-beta.2 → 0.6.9-beta.4

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 CHANGED
@@ -413,7 +413,9 @@ function mapUserProfile(raw, userAddress) {
413
413
  chains: raw.chains || [],
414
414
  strategy: raw.strategy,
415
415
  hasActiveSessionKey: raw.hasActiveSessionKey || false,
416
- protocols: raw.protocols || []
416
+ protocols: raw.protocols || [],
417
+ splitting: raw.splitting,
418
+ minSplits: raw.minSplits
417
419
  };
418
420
  }
419
421
  function mapApyByStrategy(raw) {
@@ -1264,6 +1266,16 @@ var ZyfaiAgent = class {
1264
1266
  await this.connectAuth(state, chainId);
1265
1267
  const validChainId = isValidChainId(chainId);
1266
1268
  const raw = await this.sdk.getUserDetails();
1269
+ debugLog("zyfai:profile", "getUserProfile \u2014 Zyfai reports", {
1270
+ asset: "USDC (default \u2014 no asset passed)",
1271
+ splitting: raw.splitting,
1272
+ minSplits: raw.minSplits,
1273
+ strategy: raw.strategy,
1274
+ chains: raw.chains,
1275
+ protocolCount: raw.protocols?.length,
1276
+ hasActiveSessionKey: raw.hasActiveSessionKey,
1277
+ smartWallet: raw.smartWallet
1278
+ });
1267
1279
  await this.ensureSessionKey(state, this.getAddress(), validChainId);
1268
1280
  return mapUserProfile(raw, this.connectedAddress);
1269
1281
  }
package/dist/index.d.cts CHANGED
@@ -110,14 +110,37 @@ type DepositOptions = {
110
110
  onApproved?: () => void;
111
111
  };
112
112
 
113
+ /**
114
+ * One protocol's pool selection on one chain. `pools` holds Zyfai pool NAMES
115
+ * verbatim — matched case-sensitively by customizeBatch, and an unrecognised
116
+ * name makes Zyfai's rebalance engine skip the whole protocol, so these strings
117
+ * must not be normalised anywhere.
118
+ *
119
+ * An empty array means "no usable pools on this chain".
120
+ */
121
+ type OrgPoolSelection = {
122
+ protocolId: string;
123
+ chainId: number;
124
+ pools: string[];
125
+ };
126
+ /**
127
+ * The partner's protocol/pool policy (ROUT-224). Sparse — only protocols they
128
+ * narrowed appear. Optional so an older routing API, which does not return the
129
+ * field, still parses; undefined and null both mean "change nothing".
130
+ */
131
+ type OrgPoolPolicy = {
132
+ autoApproveProtocols: boolean;
133
+ autoApprovePools: boolean;
134
+ selections: OrgPoolSelection[];
135
+ };
113
136
  /**
114
137
  * The organization's agent execution policy, or null when the partner has never
115
138
  * configured one — in which case the agents leave the user's profile alone.
116
- * Currently capital splitting only (ROUT-229).
117
139
  */
118
140
  type OrgAgentConfig = {
119
141
  splittingMode: "none" | "automatic" | "force";
120
142
  minSplits: number | null;
143
+ poolPolicy?: OrgPoolPolicy | null;
121
144
  };
122
145
 
123
146
  interface OwneyDepositResult {
@@ -272,6 +295,19 @@ interface AgentUserProfile {
272
295
  strategy?: string;
273
296
  hasActiveSessionKey: boolean;
274
297
  protocols: string[];
298
+ /**
299
+ * Capital splitting, as the agent currently has it (ROUT-229). Optional
300
+ * because not every agent has the concept — Sail omits both.
301
+ *
302
+ * `minSplits` is the field that carries the meaning: 1 means "split only when
303
+ * it beats a single pool", 2-4 means "force a split for diversification".
304
+ *
305
+ * Zyfai stores these PER ASSET. This profile read does not pass an asset, so
306
+ * these reflect the USDC bucket; a WETH-only user's real setting is not shown
307
+ * here.
308
+ */
309
+ splitting?: boolean;
310
+ minSplits?: number;
275
311
  }
276
312
  interface OwneyUserProfile {
277
313
  agentUserProfile: Record<AgentId, AgentUserProfile>;
package/dist/index.d.ts CHANGED
@@ -110,14 +110,37 @@ type DepositOptions = {
110
110
  onApproved?: () => void;
111
111
  };
112
112
 
113
+ /**
114
+ * One protocol's pool selection on one chain. `pools` holds Zyfai pool NAMES
115
+ * verbatim — matched case-sensitively by customizeBatch, and an unrecognised
116
+ * name makes Zyfai's rebalance engine skip the whole protocol, so these strings
117
+ * must not be normalised anywhere.
118
+ *
119
+ * An empty array means "no usable pools on this chain".
120
+ */
121
+ type OrgPoolSelection = {
122
+ protocolId: string;
123
+ chainId: number;
124
+ pools: string[];
125
+ };
126
+ /**
127
+ * The partner's protocol/pool policy (ROUT-224). Sparse — only protocols they
128
+ * narrowed appear. Optional so an older routing API, which does not return the
129
+ * field, still parses; undefined and null both mean "change nothing".
130
+ */
131
+ type OrgPoolPolicy = {
132
+ autoApproveProtocols: boolean;
133
+ autoApprovePools: boolean;
134
+ selections: OrgPoolSelection[];
135
+ };
113
136
  /**
114
137
  * The organization's agent execution policy, or null when the partner has never
115
138
  * configured one — in which case the agents leave the user's profile alone.
116
- * Currently capital splitting only (ROUT-229).
117
139
  */
118
140
  type OrgAgentConfig = {
119
141
  splittingMode: "none" | "automatic" | "force";
120
142
  minSplits: number | null;
143
+ poolPolicy?: OrgPoolPolicy | null;
121
144
  };
122
145
 
123
146
  interface OwneyDepositResult {
@@ -272,6 +295,19 @@ interface AgentUserProfile {
272
295
  strategy?: string;
273
296
  hasActiveSessionKey: boolean;
274
297
  protocols: string[];
298
+ /**
299
+ * Capital splitting, as the agent currently has it (ROUT-229). Optional
300
+ * because not every agent has the concept — Sail omits both.
301
+ *
302
+ * `minSplits` is the field that carries the meaning: 1 means "split only when
303
+ * it beats a single pool", 2-4 means "force a split for diversification".
304
+ *
305
+ * Zyfai stores these PER ASSET. This profile read does not pass an asset, so
306
+ * these reflect the USDC bucket; a WETH-only user's real setting is not shown
307
+ * here.
308
+ */
309
+ splitting?: boolean;
310
+ minSplits?: number;
275
311
  }
276
312
  interface OwneyUserProfile {
277
313
  agentUserProfile: Record<AgentId, AgentUserProfile>;
package/dist/index.js CHANGED
@@ -380,7 +380,9 @@ function mapUserProfile(raw, userAddress) {
380
380
  chains: raw.chains || [],
381
381
  strategy: raw.strategy,
382
382
  hasActiveSessionKey: raw.hasActiveSessionKey || false,
383
- protocols: raw.protocols || []
383
+ protocols: raw.protocols || [],
384
+ splitting: raw.splitting,
385
+ minSplits: raw.minSplits
384
386
  };
385
387
  }
386
388
  function mapApyByStrategy(raw) {
@@ -1231,6 +1233,16 @@ var ZyfaiAgent = class {
1231
1233
  await this.connectAuth(state, chainId);
1232
1234
  const validChainId = isValidChainId(chainId);
1233
1235
  const raw = await this.sdk.getUserDetails();
1236
+ debugLog("zyfai:profile", "getUserProfile \u2014 Zyfai reports", {
1237
+ asset: "USDC (default \u2014 no asset passed)",
1238
+ splitting: raw.splitting,
1239
+ minSplits: raw.minSplits,
1240
+ strategy: raw.strategy,
1241
+ chains: raw.chains,
1242
+ protocolCount: raw.protocols?.length,
1243
+ hasActiveSessionKey: raw.hasActiveSessionKey,
1244
+ smartWallet: raw.smartWallet
1245
+ });
1234
1246
  await this.ensureSessionKey(state, this.getAddress(), validChainId);
1235
1247
  return mapUserProfile(raw, this.connectedAddress);
1236
1248
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owney/sdk",
3
- "version": "0.6.9-beta.2",
3
+ "version": "0.6.9-beta.4",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",