@pushchain/core 6.0.27-alpha.4 → 6.0.27-alpha.5

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/AGW.md CHANGED
@@ -353,3 +353,11 @@ Uniswap uses destination WETH/Circle USDC; Aave uses its faucet LINK. Their gene
353
353
  The additional opt-in group `agw-presets-expanded` covers EigenLayer deposits on Sepolia; Uniswap swaps on Base/Arbitrum Sepolia; PancakeSwap plus Venus on BNB testnet; and Aave plus Moonwell on Base Sepolia. Use the same preflight/run commands with `--group agw-presets-expanded`. Each scenario funds a fresh wallet with at most 100 PC and checks any required destination-native PRC20 before transfer. Native-wrap cases use 10^12 raw native-token units. These are deposit/swap/redemption checks, not borrow/repay or every-market coverage.
354
354
 
355
355
  AGW token resolution uses the destination chain for ordinary token objects: an explicit Base or Arbitrum ETH token must not select Sepolia's PRC20 merely because its symbol/address is identical. An explicit Push PRC20 reference must name the same source chain as the destination; a mismatch fails before signing.
356
+
357
+ ### Creation UI: apps, tokens and preset availability
358
+
359
+ A rule requires at least one allowed function, even when tokens and limits are selected. A tokens-only rule returns `INVALID_RULE`, with `details.reason = 'ALLOWED_FUNCTION_REQUIRED'` and actionable `userMessage`. App selection can only be hidden if the application explicitly supplies the intended function permissions; the SDK does not invent transfer recipients or permissions.
360
+
361
+ `assets: []` remains valid for a universal rule with allowed calls. It grants no token transfers from Push; it never means all tokens. Allowed calls may still interact with destination-held assets under their configured constraints. There is no all-token wildcard. List each permitted token and cap explicitly (at most eight assets).
362
+
363
+ For presets, check `readiness.ready` before enabling Create. Display the per-chain issues and the affected token address. Empty selections explain that transfers from Push are disabled. `BRIDGE_ASSET_UNAVAILABLE` identifies an unverified SDK route, not proof that no deployment exists anywhere. Do not substitute a routed token solely because its symbol matches: the protocol must support that exact address, and swaps need compatible liquidity. A transfer-only helper and additional token routes are not included in this update.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ @pushchain/core@6.0.27-alpha.5 (2026-10-20)
2
+
3
+ - fix: clarify agentic creation permissions and route guidance
4
+
5
+ ---
6
+
1
7
  @pushchain/core@6.0.27-alpha.4 (2026-10-20)
2
8
 
3
9
  - fix: remove preset funding mode and preserve asset limits
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushchain/core",
3
- "version": "6.0.27-alpha.4",
3
+ "version": "6.0.27-alpha.5",
4
4
  "homepage": "https://push.org",
5
5
  "keywords": [
6
6
  "pushchain",
@@ -43,6 +43,8 @@ function agenticUserMessage(code, diagnostic, details) {
43
43
  }
44
44
  if (code !== 'INVALID_RULE')
45
45
  return MESSAGES[code];
46
+ if (details?.['reason'] === 'ALLOWED_FUNCTION_REQUIRED')
47
+ return 'Add at least one allowed function. Selecting tokens and limits alone does not authorize transfers.';
46
48
  if (/validUntil|expiry|expired|future.*timestamp/i.test(diagnostic))
47
49
  return 'Choose an expiry date in the future.';
48
50
  if (/label.*(64|length|most)/i.test(diagnostic))
@@ -144,7 +144,7 @@ function tokenRouteUnavailable(cause, token, chainNamespace, assetIndex) {
144
144
  const message = `This token cannot be sent from Push to ${network}. Choose a token with a supported Push route.`;
145
145
  return new AgenticError(exports.AGENTIC_ERROR_CODE.TOKEN_ROUTE_UNAVAILABLE, message, {
146
146
  userMessage: message,
147
- hint: 'Choose a supported token on this network, or wait for a verified PRC20 route for this exact token address. Token symbols alone do not identify a route.',
147
+ hint: 'Choose a supported token on this network, or wait for a verified PRC20 route for this exact token address. The selected app must also support that exact token address; matching symbols are not sufficient.',
148
148
  details: {
149
149
  token,
150
150
  chainNamespace,
@@ -313,7 +313,7 @@ function buildPresetApi(catalog) {
313
313
  if (!selectedAssets.length)
314
314
  issues.push({
315
315
  code: 'ASSETS_REQUIRED',
316
- message: 'Choose tokens and their limits, then regenerate this preset.',
316
+ message: 'No tokens selected: transfers from Push are disabled, not unrestricted. Choose explicit tokens and limits, then regenerate this preset.',
317
317
  });
318
318
  if (chain.swapRouters?.length && selectedAssets.length < 2)
319
319
  issues.push({
@@ -40,7 +40,7 @@ function presetRoutes(chain, assets, network) {
40
40
  issues.push({
41
41
  code: 'BRIDGE_ASSET_UNAVAILABLE',
42
42
  token,
43
- message: `No SDK PRC20 mapping for ${chain}:${token} on ${network}. Choose a supported asset. This exact token needs a verified Push PRC20 route before it can be used.`,
43
+ message: `No SDK PRC20 mapping for ${chain}:${token} on ${network}. This preset cannot be created with this token until its Push route is verified. Choose a routed token only if the selected app supports that exact token address.`,
44
44
  });
45
45
  return { token, status: 'unavailable' };
46
46
  }
@@ -117,6 +117,11 @@ async function normalizePublicRule(input, wallet, runtime) {
117
117
  r.validUntil <= runtime.nowSeconds() ||
118
118
  r.validUntil >= 2 ** 48)
119
119
  throw invalid('validUntil must be a future uint48 timestamp');
120
+ if (r.allowedCalls === undefined ||
121
+ (Array.isArray(r.allowedCalls) && !r.allowedCalls.length))
122
+ throw new errors_1.AgenticError(errors_1.AGENTIC_ERROR_CODE.INVALID_RULE, 'Add at least one allowed function. Selecting tokens and limits alone does not authorize transfers.', {
123
+ details: { reason: 'ALLOWED_FUNCTION_REQUIRED', field: 'allowedCalls' },
124
+ });
120
125
  if (!Array.isArray(r.allowedCalls) ||
121
126
  r.allowedCalls.length < 1 ||
122
127
  r.allowedCalls.length > 32)