@owney/sdk 0.7.26-beta.0 → 0.7.26-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/dist/index.cjs CHANGED
@@ -2282,7 +2282,7 @@ function createSwapApi(baseUrl, apiKey) {
2282
2282
  /** Source assets the user may pay with, and each chain's deposit targets. */
2283
2283
  listTokens: () => request(baseUrl, apiKey, "/tokens"),
2284
2284
  /**
2285
- * Search one chain's payable-with assets by name, symbol or address.
2285
+ * Search the payable-with assets by name, symbol or address.
2286
2286
  *
2287
2287
  * Separate from `listTokens` on purpose: the full set is thousands of
2288
2288
  * tokens per chain, far too much to ship to a picker, so the short list
@@ -2295,8 +2295,10 @@ function createSwapApi(baseUrl, apiKey) {
2295
2295
  baseUrl,
2296
2296
  apiKey,
2297
2297
  `/tokens/search?${new URLSearchParams({
2298
- chainId: String(params.chainId),
2299
2298
  query: params.query,
2299
+ // Omitted, the routing API searches every supported chain — which is
2300
+ // what a picker wants, since its rows already span all three.
2301
+ ...params.chainId === void 0 ? {} : { chainId: String(params.chainId) },
2300
2302
  ...params.limit === void 0 ? {} : { limit: String(params.limit) }
2301
2303
  }).toString()}`
2302
2304
  ),
@@ -4429,7 +4431,7 @@ var OwneySDK = class {
4429
4431
  return this.swapApi().listTokens();
4430
4432
  }
4431
4433
  /**
4432
- * Search the assets a user may pay with on one chain.
4434
+ * Search the assets a user may pay with, across every supported chain.
4433
4435
  *
4434
4436
  * `getSwapTokens` returns the short list worth rendering unprompted. This
4435
4437
  * reaches everything else the routing API will accept — thousands per chain
@@ -4447,8 +4449,8 @@ var OwneySDK = class {
4447
4449
  const query = params.query.trim();
4448
4450
  if (!query) return { tokens: [] };
4449
4451
  return this.swapApi().searchTokens({
4450
- chainId: params.chainId,
4451
4452
  query,
4453
+ ...params.chainId === void 0 ? {} : { chainId: params.chainId },
4452
4454
  ...params.limit === void 0 ? {} : { limit: params.limit }
4453
4455
  });
4454
4456
  }
@@ -4573,7 +4575,7 @@ var OwneySDK = class {
4573
4575
  options.onSwapProgress?.("withdrawing");
4574
4576
  const withdraw = await this.withdraw({
4575
4577
  asset: options.from.symbol,
4576
- ...options.amount === void 0 ? {} : { amount: options.amount },
4578
+ ...options.amount === void 0 ? {} : { amount: (0, import_viem8.parseUnits)(options.amount, asset.decimals).toString() },
4577
4579
  ...options.agentId ? { agentId: options.agentId } : {}
4578
4580
  });
4579
4581
  const arrived = await awaitWithdrawalArrival({
package/dist/index.d.cts CHANGED
@@ -910,7 +910,7 @@ declare class OwneySDK {
910
910
  chains: SwapChainTokens[];
911
911
  }>;
912
912
  /**
913
- * Search the assets a user may pay with on one chain.
913
+ * Search the assets a user may pay with, across every supported chain.
914
914
  *
915
915
  * `getSwapTokens` returns the short list worth rendering unprompted. This
916
916
  * reaches everything else the routing API will accept — thousands per chain
@@ -925,7 +925,8 @@ declare class OwneySDK {
925
925
  * Returns nothing for a blank query rather than asking for the whole list.
926
926
  */
927
927
  searchSwapTokens(params: {
928
- chainId: number;
928
+ /** Omit to search every supported chain. */
929
+ chainId?: number;
929
930
  query: string;
930
931
  limit?: number;
931
932
  }): Promise<{
package/dist/index.d.ts CHANGED
@@ -910,7 +910,7 @@ declare class OwneySDK {
910
910
  chains: SwapChainTokens[];
911
911
  }>;
912
912
  /**
913
- * Search the assets a user may pay with on one chain.
913
+ * Search the assets a user may pay with, across every supported chain.
914
914
  *
915
915
  * `getSwapTokens` returns the short list worth rendering unprompted. This
916
916
  * reaches everything else the routing API will accept — thousands per chain
@@ -925,7 +925,8 @@ declare class OwneySDK {
925
925
  * Returns nothing for a blank query rather than asking for the whole list.
926
926
  */
927
927
  searchSwapTokens(params: {
928
- chainId: number;
928
+ /** Omit to search every supported chain. */
929
+ chainId?: number;
929
930
  query: string;
930
931
  limit?: number;
931
932
  }): Promise<{
package/dist/index.js CHANGED
@@ -2248,7 +2248,7 @@ function createSwapApi(baseUrl, apiKey) {
2248
2248
  /** Source assets the user may pay with, and each chain's deposit targets. */
2249
2249
  listTokens: () => request(baseUrl, apiKey, "/tokens"),
2250
2250
  /**
2251
- * Search one chain's payable-with assets by name, symbol or address.
2251
+ * Search the payable-with assets by name, symbol or address.
2252
2252
  *
2253
2253
  * Separate from `listTokens` on purpose: the full set is thousands of
2254
2254
  * tokens per chain, far too much to ship to a picker, so the short list
@@ -2261,8 +2261,10 @@ function createSwapApi(baseUrl, apiKey) {
2261
2261
  baseUrl,
2262
2262
  apiKey,
2263
2263
  `/tokens/search?${new URLSearchParams({
2264
- chainId: String(params.chainId),
2265
2264
  query: params.query,
2265
+ // Omitted, the routing API searches every supported chain — which is
2266
+ // what a picker wants, since its rows already span all three.
2267
+ ...params.chainId === void 0 ? {} : { chainId: String(params.chainId) },
2266
2268
  ...params.limit === void 0 ? {} : { limit: String(params.limit) }
2267
2269
  }).toString()}`
2268
2270
  ),
@@ -3028,6 +3030,7 @@ function aggregateApyByChainAndAsset(agentApys, agentBalances) {
3028
3030
 
3029
3031
  // src/client.ts
3030
3032
  import {
3033
+ parseUnits as parseUnits2,
3031
3034
  createPublicClient as createPublicClient2,
3032
3035
  createWalletClient,
3033
3036
  custom,
@@ -4400,7 +4403,7 @@ var OwneySDK = class {
4400
4403
  return this.swapApi().listTokens();
4401
4404
  }
4402
4405
  /**
4403
- * Search the assets a user may pay with on one chain.
4406
+ * Search the assets a user may pay with, across every supported chain.
4404
4407
  *
4405
4408
  * `getSwapTokens` returns the short list worth rendering unprompted. This
4406
4409
  * reaches everything else the routing API will accept — thousands per chain
@@ -4418,8 +4421,8 @@ var OwneySDK = class {
4418
4421
  const query = params.query.trim();
4419
4422
  if (!query) return { tokens: [] };
4420
4423
  return this.swapApi().searchTokens({
4421
- chainId: params.chainId,
4422
4424
  query,
4425
+ ...params.chainId === void 0 ? {} : { chainId: params.chainId },
4423
4426
  ...params.limit === void 0 ? {} : { limit: params.limit }
4424
4427
  });
4425
4428
  }
@@ -4544,7 +4547,7 @@ var OwneySDK = class {
4544
4547
  options.onSwapProgress?.("withdrawing");
4545
4548
  const withdraw = await this.withdraw({
4546
4549
  asset: options.from.symbol,
4547
- ...options.amount === void 0 ? {} : { amount: options.amount },
4550
+ ...options.amount === void 0 ? {} : { amount: parseUnits2(options.amount, asset.decimals).toString() },
4548
4551
  ...options.agentId ? { agentId: options.agentId } : {}
4549
4552
  });
4550
4553
  const arrived = await awaitWithdrawalArrival({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owney/sdk",
3
- "version": "0.7.26-beta.0",
3
+ "version": "0.7.26-beta.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",