Feature - #6
Merged
Merged
Feature#6
Conversation
…ogram ID, and optimize account access with Box
There was a problem hiding this comment.
Pull request overview
This PR introduces an off-chain “relayer/guardian” TypeScript app for the Intentra protocol, expands Anchor tests to cover protocol initialization / solver registration / intent posting + paused behavior, and updates project configuration + dependencies to support SPL token usage and newer toolchain versions.
Changes:
- Added a new
app/relayer package that polls for Claimed intents, watches destination-chain ERC20 transfers, and submitssettle_intent. - Replaced the placeholder Anchor test with integration-style tests for protocol config, solver registration, intent posting/escrow locking, and paused enforcement.
- Updated configs and lockfiles (Anchor toolchain version, localnet program id, Cargo.lock crate bumps, SPL token dependency/lockfile updates).
Reviewed changes
Copilot reviewed 14 out of 17 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Dependency graph changes from adding SPL token support and related transitive packages. |
| txtx.yml | Renames project metadata (name/id) to intentra. |
| tests/intentra.ts | Adds protocol/solver/intent/paused test coverage using SPL token mints and escrow assertions. |
| programs/intentra/src/instructions/register_solver.rs | Minor formatting-only change (trailing newline). |
| package.json | Adds @solana/spl-token dependency to support token ops in tests. |
| Cargo.lock | Updates several Rust crate versions (borsh/bytes/log/quote, etc.). |
| app/tsconfig.json | New TS config for building the relayer package. |
| app/src/types.ts | New shared types/constants for intents and delivery proofs. |
| app/src/solana.ts | Builds Anchor provider/program, PDA helpers, and on-chain Claimed intent fetch. |
| app/src/settler.ts | Submits settle_intent transactions with retries. |
| app/src/index.ts | Implements the relayer main loop and dispatch logic. |
| app/src/evm-watcher.ts | Watches EVM ERC20 Transfer logs to confirm delivery. |
| app/src/config.ts | Loads env/config and sets up logging. |
| app/package.json | New relayer package manifest (scripts + deps). |
| app/.env.example | Example environment configuration for the relayer. |
| Anchor.toml | Pins anchor version and updates localnet program id. |
| .gitignore | Adds ignores for /runbooks, .surfpool, /doc. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+12
to
+20
| "dependencies": { | ||
| "@coral-xyz/anchor": "^0.31.0", | ||
| "@solana/web3.js": "^1.98.0", | ||
| "@solana/spl-token": "^0.4.9", | ||
| "dotenv": "^16.4.5", | ||
| "ethers": "^6.13.2", | ||
| "pino": "^9.3.2", | ||
| "pino-pretty": "^11.2.2" | ||
| }, |
Comment on lines
+47
to
+50
| const solverInputAta = getAssociatedTokenAddressSync( | ||
| intent.inputMint, | ||
| solver | ||
| ); |
Comment on lines
+6
to
+10
| import { | ||
| getOrCreateAssociatedTokenAccount, | ||
| getAssociatedTokenAddressSync, | ||
| } from "@solana/spl-token"; | ||
| import { Program, BN } from "@coral-xyz/anchor"; |
Comment on lines
+68
to
+70
| feeVault, | ||
| tokenProgram: new PublicKey("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"), | ||
| systemProgram: SystemProgram.programId, |
Comment on lines
+1
to
+6
| import { | ||
| Connection, | ||
| Keypair, | ||
| PublicKey, | ||
| clusterApiUrl, | ||
| } from "@solana/web3.js"; |
Comment on lines
+33
to
+36
| signAllTransactions: async (txs: any[]) => { | ||
| txs.forEach((tx) => tx.sign(guardian)); | ||
| return txs; | ||
| }, |
Comment on lines
+11
to
+12
| import type { Intentra } from "../../target/types/intentra"; | ||
| import idl from "../../target/idl/intentra.json"; |
Comment on lines
+34
to
+37
| const fromBlock = this.lastCheckedBlock > 0 | ||
| ? this.lastCheckedBlock + 1 | ||
| : latestBlock - 20; | ||
| if (fromBlock > latestBlock) return deliveries; |
Comment on lines
+102
to
+103
| const TOKEN_REGISTRY: Record<string, string> = { | ||
| }; |
Comment on lines
+8
to
+12
| PROGRAM_ID=GuEj8Dv2U2v6byeLCzTuEMLKSJQ3YN9RmUHY4gx8ZNGc | ||
|
|
||
|
|
||
| # Ethereum (chain 2) | ||
| EVM_CHAIN_2_RPC=https://eth-mainnet.g.alchemy.com/v2/<your-key> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.