Skip to content

[TKAI-4349] create a webhook to send swap events tkai bepro to zapier#14

Merged
hvasconcelos merged 8 commits intodevelopfrom
TKAI-4349-create-a-webhook-to-send-swap-events-tkai-bepro-to-zapier
Jan 7, 2026
Merged

[TKAI-4349] create a webhook to send swap events tkai bepro to zapier#14
hvasconcelos merged 8 commits intodevelopfrom
TKAI-4349-create-a-webhook-to-send-swap-events-tkai-bepro-to-zapier

Conversation

@vhcsilva
Copy link
Copy Markdown
Contributor

No description provided.

Vitor Hugo and others added 5 commits December 16, 2025 10:45
Add detailed error and halt logging to the Virtual Machine with:
- Cast ID, event name, and block number context
- Instruction that caused the halt/error
- Full backtrace of executed instructions with args
- Differentiation between errors and intentional halts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@hvasconcelos hvasconcelos merged commit 651d780 into develop Jan 7, 2026
1 of 2 checks passed
hvasconcelos added a commit that referenced this pull request Jan 7, 2026
Migration to Bun Runtime

* Replace dappkit  and ethers with viem (#13)

* Bun Runtime

* ChainCast

* ci

* ci-cd

* Opus is a beast 😱

* [TKAI-4349] create a webhook to send swap events tkai bepro to zapier (#14)

* chore: add missing dependency

* feat: add json parse instruction

* refactor: fix template args

* refactor: add lib to convert bigint to string on objects

* refactor: undo change

* chore: remove web3

* refactor: use viem instead of web3

* feat: improve VM error logging with context and backtrace

Add detailed error and halt logging to the Virtual Machine with:
- Cast ID, event name, and block number context
- Instruction that caused the halt/error
- Full backtrace of executed instructions with args
- Differentiation between errors and intentional halts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Vitor Hugo <vhcsilva@gmail.com>
Co-authored-by: Helder Vasconcelos <heldervasc@bearstouch.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* Fix CI: upgrade setup-bun to v2 and codecov-action to v5

- setup-bun v1 has caching bugs causing HTTP 400 errors
- codecov-action v5 is the latest stable version

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Upload

* Migrate from ESLint + Prettier to Biome

- Add biome.json configuration with equivalent formatting rules
- Remove ESLint and Prettier configs (.eslintrc.json, .prettierrc.json, etc.)
- Remove 14 ESLint/Prettier dependencies, add @biomejs/biome
- Update package.json scripts: lint, lint:fix, format, check, check:fix
- Fix catch clause type annotations (Error | any → unknown)
- Format entire codebase with Biome
- Update CLAUDE.md and README.md documentation

Benefits:
- 10-100x faster linting and formatting
- Single tool replaces ESLint + Prettier
- Fewer dependencies, smaller node_modules
- Auto-organized imports

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Upload

* Upload

---------

Co-authored-by: Vitor Hugo <9003126+vhcsilva@users.noreply.github.com>
Co-authored-by: Vitor Hugo <vhcsilva@gmail.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
hvasconcelos added a commit that referenced this pull request Jan 7, 2026
* Working

* Merge pull request #12 from layerx-labs/hcv_migration_to_bun

Migration to Bun Runtime

* Replace dappkit  and ethers with viem (#13)

* Bun Runtime

* ChainCast

* ci

* ci-cd

* Opus is a beast 😱

* [TKAI-4349] create a webhook to send swap events tkai bepro to zapier (#14)

* chore: add missing dependency

* feat: add json parse instruction

* refactor: fix template args

* refactor: add lib to convert bigint to string on objects

* refactor: undo change

* chore: remove web3

* refactor: use viem instead of web3

* feat: improve VM error logging with context and backtrace

Add detailed error and halt logging to the Virtual Machine with:
- Cast ID, event name, and block number context
- Instruction that caused the halt/error
- Full backtrace of executed instructions with args
- Differentiation between errors and intentional halts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Vitor Hugo <vhcsilva@gmail.com>
Co-authored-by: Helder Vasconcelos <heldervasc@bearstouch.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* Fix CI: upgrade setup-bun to v2 and codecov-action to v5

- setup-bun v1 has caching bugs causing HTTP 400 errors
- codecov-action v5 is the latest stable version

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Upload

* Add unit tests for mocks, utilities, and instructions

- Add mock utilities for Prisma, viem client, external services, and logging
- Add test fixtures for events, casts, and programs
- Add unit tests for utility functions (getVariableFromPath)
- Add unit tests for core library (Stack, ChainCastProgram, ChainCastVirtualMachine)
- Add unit tests for all 13 instruction plugins:
  - debug, set, filter-events, condition
  - transform-string, transform-number, transform-array, transform-object, transform-template
  - webhook, bullmq, elasticsearch, spreadsheet

Tests: 286 passing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* Add test scripts and CI/CD test execution

- Add test:watch script for continuous test running during development
- Add test:debug script with --inspect-brk for debugging tests
- Update CI/CD pipeline to run tests after build
- Add coverage reporting to Codecov (no threshold enforcement)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* Add service tests for ChainCastSecretManager

- Add comprehensive tests for secret manager CRUD operations
- Test addSecrets, addSecret, deleteSecret, updateSecret, getSecret, getSecrets
- Add integration scenario tests for typical cast workflows

Tests: 302 passing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* Add contract cast, listener, retriever, manager and GraphQL resolver tests

- Create contract-cast.test.ts with tests for EVMContractCast
  - Constructor, getters, loadSecrets, loadProgram
  - Status management, onEvent handling
  - Event recovery progress tracking

- Create contract-listener.test.ts with tests for EVMContractListener
  - Event extraction from ABI, startListening/stopListening
  - Handler management and connection callbacks

- Create contract-event-retriever.test.ts with tests for EVMContractEventRetriever
  - Batch event fetching and recovery
  - Progress reporting and stop condition handling
  - Event format conversion (viem to Web3Event)

- Create chaincast-manager.test.ts with tests for ChainCastManager
  - Instruction registration
  - Cast lifecycle management (start, stop, add, delete, restart)
  - Database integration

- Create GraphQL resolver tests
  - contract-cast.test.ts: contractCast query, CRUD mutations
  - secret.test.ts: create, update, delete secret mutations

Total: 410 tests passing, 86.05% line coverage

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* Fixed

* Fix program tests for cross-platform compatibility

Move Zod schemas outside mock classes and use explicit constructors
to ensure proper initialization order across different Bun environments
(macOS vs Linux).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* Fix program tests: use actual instruction classes

Replace mock instruction classes with actual Debug and Set instruction
classes from the codebase to ensure cross-platform compatibility.

The mock classes had constructor/property initialization issues that
caused different behavior on Linux vs macOS in Bun.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* Fix cross-platform base64 encoding in program tests

- Replace btoa() with Buffer.from().toString('base64') in tests
- Change toString('ascii') to toString('utf-8') in program decoder
- Add encodeInstructions() helper for consistent encoding

The btoa/ascii combination behaved inconsistently between macOS and
Linux in GitHub Actions. Using Buffer with utf-8 encoding ensures
reliable cross-platform behavior.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fixed

---------

Co-authored-by: Vitor Hugo <9003126+vhcsilva@users.noreply.github.com>
Co-authored-by: Vitor Hugo <vhcsilva@gmail.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
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