apinow-sdk 0.29.1 → 0.30.0

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.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const APINOW_SDK_VERSION = "0.29.1";
1
+ export declare const APINOW_SDK_VERSION = "0.30.0";
2
2
  export interface CallOptions {
3
3
  method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
4
4
  body?: Record<string, any>;
@@ -61,17 +61,26 @@ export interface SplitConfig {
61
61
  * { address, amount: "0.05" } // USDC dollars
62
62
  * { address, percent: 30 } // 30.00 %
63
63
  *
64
- * The array as a whole must still sum to 10000 bps (100%). Mix and match
65
- * per entry; amount / percent are just convenience forms so you don't
66
- * have to compute bps manually.
64
+ * The array as a whole must still sum to 10000 bps (100%), with ±0.01
65
+ * bps tolerance. Mix and match per entry.
66
+ *
67
+ * Precision: `basisPoints` accepts fractional values up to 2 decimal
68
+ * places (e.g. `600.6`), matching the 4-decimal `percentAllocation`
69
+ * that 0xSplits V2 supports natively. This means amount inputs like
70
+ * `"0.02"` on a `"0.333"` total survive as 600.6 bps (6.006 %) instead
71
+ * of rounding to 601 bps. Use amount / percent inputs and let the
72
+ * backend compute the exact bps for you.
67
73
  */
68
74
  export interface SplitInput {
69
75
  address: string;
70
76
  label?: string;
71
77
  tokenAddress?: string;
72
78
  recipientAddress?: string;
79
+ /** 0–10000, up to 2 decimal places of bps (= 4 decimal places of %). */
73
80
  basisPoints?: number;
81
+ /** USDC dollars. Converted via `amount / totalPrice * 10000` at 2-decimal bps. */
74
82
  amount?: number | string;
83
+ /** 0–100, up to 4 decimal places. Converted via `percent * 100`. */
75
84
  percent?: number | string;
76
85
  }
77
86
  /**
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { x402Client, wrapFetchWithPayment } from '@x402/fetch';
2
2
  import { registerExactEvmScheme } from '@x402/evm/exact/client';
3
3
  import { privateKeyToAccount } from 'viem/accounts';
4
4
  const APINOW_BASE = 'https://www.apinow.fun';
5
- export const APINOW_SDK_VERSION = '0.29.1';
5
+ export const APINOW_SDK_VERSION = '0.30.0';
6
6
  /**
7
7
  * Default base URL. In a browser we prefer the current origin so that
8
8
  * signed-auth writes stay same-origin and don't hit a CORS preflight
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apinow-sdk",
3
- "version": "0.29.1",
3
+ "version": "0.30.0",
4
4
  "description": "Pay-per-call API SDK & CLI for APINow.fun — endpoints + workflows, wraps x402 so you don't have to",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",