Skip to content

Feature/webhook callback#1

Merged
AkshatGada merged 12 commits intomainfrom
feature/webhook-callback
Feb 17, 2026
Merged

Feature/webhook callback#1
AkshatGada merged 12 commits intomainfrom
feature/webhook-callback

Conversation

@AkshatGada
Copy link
Copy Markdown
Collaborator

No description provided.

wallet create --wait starts a temp HTTP server on localhost, adds
callbackUrl to the connector URL, and the connector UI POSTs the
encrypted ciphertext directly back. Eliminates copy/paste of the
~8000-char blob, solving Telegram's 4096-char truncation issue.

- Extract shared decryptAndSaveSession() helper
- Add walletCreateAndWait() with CORS, timeout, body limit
- Relax connector UI callback validation for localhost
- Update SKILL.md with webhook callback docs

Entire-Checkpoint: 7be724092f02
Tailwind CSS v4, lucide-react icons, Inter/JetBrains Mono fonts,
animated cards, gradient borders, pulse glow, staggered balance rows,
Polygon logo in brand header, and polished post-approval state.

Entire-Checkpoint: 411d50197102
…hook callback

Entire-Checkpoint: eb0ae5f29980
Entire-Checkpoint: 8a5d540efcbc
Dependency Upgrades
package.json: All @0xsequence/* packages bumped from 3.0.0-beta.15 → 3.0.0-beta.16, added @0xsequence/dapp-client-cli@0.1.2
connector-ui/package.json: @0xsequence/dapp-client and @0xsequence/wallet-primitives bumped from 3.0.0-beta.12 → 3.0.0-beta.16
New Shared Wrapper
lib/dapp-client.mjs (NEW): Shared DappClient wrapper using StateManager + FileSequenceStorage + FileSessionStorage from @0xsequence/dapp-client-cli. Derives passphrase from existing ~/.polygon-agent/.encryption-key (zero new config). Exports runDappClientTx() with the full 3-tier fee options fallback.
Refactored Files
cli/commands/operations.mjs: Removed ~180 lines of duplicated KeychainSequenceStorage, MapSessionStorage, defaultNodesUrl(), and runDappClientTx(). Now imports from shared wrapper.
cli/commands/registry.mjs: Removed ~180 lines of identical duplication. Call sites transformed from runRegistryTx({ contractAddress, data }) to runDappClientTx({ chainId: 137, transactions: [{ to, value: 0n,  }] }).
lib/storage.mjs: Added state/dapp-client-cli to subdirectories, fixed recursive: true for nested dir creation.
Verification
npm install — 0 vulnerabilities
pnpm install && pnpm build — connector-ui TypeScript compiles and Vite build succeeds
wallet list — works correctly
All three refactored modules load with correct exports

Entire-Checkpoint: b0a0572fdc36
Pass spending limits and contract whitelist params through to the
connector UI URL so ecosystem wallet sessions are created with proper
authorization scope. Without these, sessions default to bare-bones
permissions and agents cannot transact.

New CLI flags: --native-limit, --usdc-limit, --usdt-limit,
--token-limit (repeatable), --usdc-to/--usdc-amount, --contract
(repeatable). Also adds getArgs() helper for repeatable args.
Fixes identified by comparing polygon-agent-kit with the upstream
Sequence ecosystem CLI and Trails CLI:

- Pass preferNativeFee: true in sendNative, sendToken, and swap to
  avoid selecting ERC20 fee tokens the wallet may not hold
- Add session expiry check before transactions (clear error instead
  of cryptic relayer failure)
- Fix balances indexer request body to match upstream format
  (filter.accountAddresses, contractStatus: VERIFIED) and handle
  multiple response shapes
- Validate --usdc-to/--usdc-amount requires both or neither
- Add TRAILS_TOKEN_MAP_JSON env override for swap token resolution
- Add --direct flag to send-native (bypass ValueForwarder)
- Add fetch debug logger (POLYGON_AGENT_DEBUG_FETCH=1)
- Add fee options debug dump (POLYGON_AGENT_DEBUG_FEE=1)

Entire-Checkpoint: f8dce7c84761
Comment thread lib/dapp-client.mjs
if (typeof origFetch !== 'function') return

const redact = (s) => String(s).slice(0, 40000)
const log = (line) => fs.appendFileSync(logPath, `[${new Date().toISOString()}] ${line}\n`, 'utf8')

Check warning

Code scanning / CodeQL

Network data written to file Medium

Write to file system depends on
Untrusted data
.
AkshatGada and others added 3 commits February 16, 2026 23:27
- Add parsing of contracts parameter (comma-separated addresses)
- Add contract whitelist permissions to session (target + empty rules)
- Fix: include dynamicTokenPermissions in session config (was built but never used)

Co-authored-by: Cursor <cursoragent@cursor.com>
Entire-Checkpoint: 932500bceae5
Document token limit flags (--native-limit, --usdc-limit, --usdt-limit,
--token-limit), contract whitelist (--contract), one-off ERC20 permissions
(--usdc-to/--usdc-amount), --direct flag for send-native, swap slippage,
debug env vars, and updated troubleshooting entries.
…ient format

Add session permission flags, --direct flag, debug env vars, expanded
commands table. Trimmed verbose output examples for agent context efficiency.

Entire-Checkpoint: a88b80be687b
@AkshatGada AkshatGada merged commit 961b551 into main Feb 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants