@owney/sdk 0.3.0 → 0.3.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/dist/index.cjs CHANGED
@@ -241,6 +241,7 @@ function mapHistory(raw, chainId) {
241
241
  const actionMap = {
242
242
  "Deposit to protocol": "Deposit",
243
243
  "Top up wallet": "Top up",
244
+ "Partial withdraw from protocol": "Withdraw",
244
245
  "Withdraw from protocol": "Withdraw",
245
246
  Rebalance: "Rebalance"
246
247
  };
@@ -1104,7 +1105,10 @@ var OwneySDK = class {
1104
1105
  { asset, agentErrors: agentErrors2 }
1105
1106
  );
1106
1107
  }
1107
- return { agentResult: results2 };
1108
+ return {
1109
+ agentResult: results2,
1110
+ totalWithdrawn: sumWithdrawnAmount(results2).toString()
1111
+ };
1108
1112
  }
1109
1113
  const requested = BigInt(amount);
1110
1114
  const aggregated = await this.getBalances();
@@ -1193,7 +1197,7 @@ var OwneySDK = class {
1193
1197
  }
1194
1198
  );
1195
1199
  }
1196
- return { agentResult: results };
1200
+ return { agentResult: results, totalWithdrawn: withdrawn.toString() };
1197
1201
  }
1198
1202
  // --- Portfolio reads ---
1199
1203
  /**
package/dist/index.d.cts CHANGED
@@ -114,6 +114,7 @@ interface AgentWithdrawResult {
114
114
  }
115
115
  interface OwneyWithdrawResult {
116
116
  agentResult: Record<AgentId, AgentWithdrawResult>;
117
+ totalWithdrawn: string;
117
118
  }
118
119
  interface OwneyToken {
119
120
  chain: OwneySupportedChains;
package/dist/index.d.ts CHANGED
@@ -114,6 +114,7 @@ interface AgentWithdrawResult {
114
114
  }
115
115
  interface OwneyWithdrawResult {
116
116
  agentResult: Record<AgentId, AgentWithdrawResult>;
117
+ totalWithdrawn: string;
117
118
  }
118
119
  interface OwneyToken {
119
120
  chain: OwneySupportedChains;
package/dist/index.js CHANGED
@@ -211,6 +211,7 @@ function mapHistory(raw, chainId) {
211
211
  const actionMap = {
212
212
  "Deposit to protocol": "Deposit",
213
213
  "Top up wallet": "Top up",
214
+ "Partial withdraw from protocol": "Withdraw",
214
215
  "Withdraw from protocol": "Withdraw",
215
216
  Rebalance: "Rebalance"
216
217
  };
@@ -1074,7 +1075,10 @@ var OwneySDK = class {
1074
1075
  { asset, agentErrors: agentErrors2 }
1075
1076
  );
1076
1077
  }
1077
- return { agentResult: results2 };
1078
+ return {
1079
+ agentResult: results2,
1080
+ totalWithdrawn: sumWithdrawnAmount(results2).toString()
1081
+ };
1078
1082
  }
1079
1083
  const requested = BigInt(amount);
1080
1084
  const aggregated = await this.getBalances();
@@ -1163,7 +1167,7 @@ var OwneySDK = class {
1163
1167
  }
1164
1168
  );
1165
1169
  }
1166
- return { agentResult: results };
1170
+ return { agentResult: results, totalWithdrawn: withdrawn.toString() };
1167
1171
  }
1168
1172
  // --- Portfolio reads ---
1169
1173
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owney/sdk",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",