当前位置: 首页 > Skill >

jovay-interaction-skill

jovay-interaction-skill

jovay-interaction-skill

使用 jovian-cli 与 Jovian 或 Ethereum 网络交互的技能

1.0.0 2026.11.22 776
获取Skill文件查看使用说明
作 者:顾宁 许可证: 更新时间:2026.11.22
本文目录展开

Jovay Interaction Skill

Description

This skill enables interaction with Jovay, a secure, open, and modular Layer2 EVM blockchain. It uses the jovay-cli tool to perform wallet management, token transfers, smart contract interactions, and network configuration.

Prerequisites

  • Node.js v20+
  • jovay-cli installed (npm install -g @jovaylabs/jovay-cli)
  • Configured wallet with private key
  • Network configured (testnet or mainnet)

Network information (official)

Canonical RPC URLs, chain IDs, explorers, and all bridge contract addresses (ETH and ERC-20) are maintained in the Jovay documentation:

  • Network Information

Quick reference — ETH bridge (same values as jovay-cli src/common/bridge.ts):

Network L1 ETH bridge L2 ETH bridge
Jovay Sepolia (testnet) 0x940eFB877281884699176892B02A3db49f29CDE8 0xD278bC7189d2ed65c005c345A0e8a387f15b7a3A
Jovay mainnet 0x922248db4a99bb542539ae7165fb9d7a546fb9f1 0xb220d17a11bd2d11e3f57a305ff5b481c81b1028

ERC-20 bridge addresses are listed only in the doc above; use jovay contract with those addresses for token approvals and transfers.

Instructions

When the user wants to interact with Jovay blockchain, follow these patterns:

Initial Setup

Note: Initialization is only required once after installation. You can verify if initialization is complete by running jovay network get. If it returns network configuration info, initialization has already been done.

  1. Initialize CLI: jovay init
  2. Check network: jovay network get
  3. Switch network: jovay network switch --network testnet|mainnet
  4. Configure wallet: jovay wallet set --sk <private-key> [--enc]

Wallet Operations

Set Wallet

Configure wallet with private key.

jovay wallet set --sk <private-key> [--enc] [--enc-key <password>]

Options:

  • --sk, --secret-key <key>: Private key (64 hex characters, with or without 0x prefix)
  • --enc: Enable encryption with auto-generated key (save the key!)
  • --enc-key <password>: Custom encryption password (auto-enables encryption)
  • --origin-enc-key <key>: Current encryption key (required when changing encrypted wallet)

Get Address

jovay wallet address

Check Balance

jovay wallet balance [options]

Options:

  • --address <0x string>: Address to query (defaults to wallet address)
  • --token <0x string>: ERC20 token address (omit for native ETH)
  • --l1: Query on Ethereum instead of Jovay
  • --rpc <url>: Custom RPC endpoint
  • --block <number>: Query at specific block height

Airdrop (Testnet Only)

Request 0.001 Jovay Sepolia ETH (once per 24 hours).

jovay wallet airdrop

Transfer

jovay wallet transfer --amount <wei> --to <address> [options]

Options:

  • --amount <bigint>: Amount in smallest unit (Wei) - required
  • --to <0x string>: Recipient address - required
  • --token <0x string>: ERC20 token address (omit for native ETH)
  • --sk <key>: Override wallet private key
  • --enc-key <password>: Encryption key for encrypted wallet
  • --l1: Transfer on Ethereum instead of Jovay
  • --rpc <url>: Custom RPC endpoint
  • --broadcast: Send transaction (without this, only outputs signed data)

Approve

jovay wallet approve --amount <amount> --to <spender> --token <address> [options]

Options:

  • --amount <bigint>: Allowance amount in smallest unit - required
  • --to <0x string>: Spender address - required
  • --token <0x string>: ERC20 token address - required
  • --sk <key>: Override wallet private key
  • --enc-key <password>: Encryption key for encrypted wallet
  • --l1: Approve on Ethereum instead of Jovay
  • --rpc <url>: Custom RPC endpoint
  • --broadcast: Send transaction (without this, only outputs signed data)

Bridge Operations

Deposit ETH (L1 → L2)

Bridge ETH from Ethereum to Jovay.

jovay bridge deposit --amount <wei> --to <l2-address> [options]

Options:

  • --amount <bigint>: Amount in Wei to deposit - required
  • --to <0x string>: Recipient address on Jovay (L2) - required
  • --gas-limit <bigint>: Gas limit reserved for the L2 finalize-deposit step (default: 200000). It must be ≥ the gas the bridge needs on Jovay; if it is too low, the L1 transaction reverts with gas limit must be bigger than or equal to the tx_fee of finalize deposit on Jovay. On Jovay Sepolia testnet, 500000 is often required. A larger limit increases msg.value (see note below).
  • --data <hex>: Optional extra data (default: 0x)
  • --sk <key>: Override wallet private key
  • --enc-key <password>: Encryption key for encrypted wallet
  • --rpc <url>: Custom L1 RPC endpoint
  • --broadcast: Send transaction (without this, only outputs signed data)

Note: The bridge requires msg.value = amount + gasLimit × L2 gas price. The CLI computes this from your configured L2 RPC and sends the correct msg.value automatically. Your L1 wallet must hold enough for that msg.value plus L1 gas. After the L1 transaction is finalized, the bridge relayer credits funds on L2.

Withdraw ETH (L2 → L1)

Bridge ETH from Jovay back to Ethereum. This is a two-step process.

jovay bridge withdraw --amount <wei> --to <l1-address> [options]

Options:

  • --amount <bigint>: Amount in Wei to withdraw - required
  • --to <0x string>: Recipient address on Ethereum (L1) - required
  • --gas-limit <bigint>: Gas limit for the L1 finalization transaction (default: 200000)
  • --data <hex>: Optional extra data (default: 0x)
  • --sk <key>: Override wallet private key
  • --enc-key <password>: Encryption key for encrypted wallet
  • --rpc <url>: Custom L2 RPC endpoint
  • --broadcast: Send transaction (without this, only outputs signed data)

Note: The bridge requires msg.value = amount + gasLimit × L1 gas price. The CLI computes this from your configured L1 RPC. Your L2 wallet must hold enough for that msg.value plus L2 gas. After the L2 transaction is confirmed, wait for the batch to be finalized on L1 (up to 1 hour). Then run jovay bridge finalize-withdraw with the proof data from the Jovay Explorer.

Finalize Withdraw (L1 - Step 2)

After the L2 withdrawal batch is finalized, claim your funds on Ethereum.

jovay bridge finalize-withdraw --amount <wei> --nonce <nonce> --msg <hex> --batch-index <index> --proof <hex> [options]

Options:

  • --amount <bigint>: The exact amount of ETH withdrawn on L2 (Wei) - required
  • --nonce <bigint>: Nonce of the cross-chain message (from SentMsg event log) - required
  • --msg <hex>: Original message from the SentMsg event log (hex, 0x-prefixed) - required
  • --batch-index <bigint>: Batch index containing the L2 withdrawal tx - required
  • --proof <hex>: SPV merkle proof from the Jovay Explorer transaction page - required
  • --sk <key>: Override wallet private key
  • --enc-key <password>: Encryption key for encrypted wallet
  • --rpc <url>: Custom L1 RPC endpoint
  • --broadcast: Send transaction (without this, only outputs signed data)

How to get proof data: Go to your L2 withdrawal transaction on the Jovay Explorer. Find the SentMsg event to get the nonce and msg. Click the block number to find the batchIndex. Copy the "Proof" hex string for --proof.

Claim Deposit (L2 - Manual)

If the automatic L1 → L2 deposit relay fails, manually claim on L2.

jovay bridge claim-deposit --msg <hex> [options]

Options:

  • --msg <hex>: Original message data from the DepositETH event log (hex, 0x-prefixed) - required
  • --sk <key>: Override wallet private key
  • --enc-key <password>: Encryption key for encrypted wallet
  • --rpc <url>: Custom L2 RPC endpoint
  • --broadcast: Send transaction (without this, only outputs signed data)

Contract Interactions

Read Contract (call)

Read data from a contract without sending a transaction.

With ABI file:

jovay contract call --contract <address> --method <name> --abi <file> --args '<json-args>'

Without ABI (manual type definition):

jovay contract call --contract <address> --method <name> --inputs <types> --outputs <types> --args '<json-args>'

Common options:

  • --contract <address>: Contract address (required)
  • --method <name>: Method name to call (required)
  • --abi <file>: Path to ABI JSON file
  • --inputs <types>: Input parameter types (e.g., address,uint256[])
  • --outputs <types>: Output parameter types (e.g., string,(address,uint256))
  • --args '<json>': Arguments as JSON array string
  • --l1: Call on Ethereum instead of Jovay
  • --rpc <url>: Custom RPC endpoint
  • --dry-run: Output encoded data without calling

Write Contract (write)

Send a transaction to modify contract state.

With ABI file:

jovay contract write --contract <address> --method <name> --abi <file> --args '<json-args>' --broadcast

Without ABI:

jovay contract write --contract <address> --method <name> --inputs <types> --args '<json-args>' --broadcast

Common options:

  • --contract <address>: Contract address (required)
  • --method <name>: Method name to call (required)
  • --abi <file>: Path to ABI JSON file
  • --inputs <types>: Input parameter types
  • --args '<json>': Arguments as JSON array string
  • --value <wei>: Native token to send (for payable functions)
  • --broadcast: Send transaction to network (required to execute)
  • --sk <key>: Override wallet private key
  • --enc-key <key>: Encryption key for encrypted wallet
  • --l1: Write on Ethereum instead of Jovay
  • --rpc <url>: Custom RPC endpoint

Type Definition Examples

Type Example
Simple types address, uint256, bool, string, bytes
Array uint256[], address[]
Tuple (address,uint256), (address,bytes32)
Complex address,uint256[],(address,bytes32)

Args Format Examples

Input Types Args Example
address '"0x1234..."'
address,uint256 '"0x1234...", 1000000'
uint256[] '[100, 200, 300]'
address,(uint256,string) '"0x1234...", [100, "hello"]'

Transaction Operations

Get Transaction Info

jovay transaction info --tx <hash> [options]

Options:

  • --tx, --transaction <hash>: Transaction hash - required
  • --raw: Display full raw JSON response instead of formatted summary
  • --abi <file>: ABI file path to decode event logs
  • --rpc <url>: Custom RPC endpoint
  • --l1: Query on Ethereum instead of Jovay

Send Raw Transaction

jovay transaction send --raw-tx <signed-tx> [options]

Options:

  • --raw-tx <string>: Signed raw transaction data - required
  • --rpc <url>: Custom RPC endpoint
  • --l1: Send to Ethereum instead of Jovay

Network Configuration

Get Network Info

jovay network get

Displays current network configuration and wallet info.

Switch Network

jovay network switch --network <testnet|mainnet> [options]

Options:

  • --network <string>: Target network - required (testnet or mainnet)
  • --api-key <string>: ZAN API key for RPC endpoints
  • --l1, --l1-rpc <url>: Custom Ethereum RPC endpoint
  • --l2, --l2-rpc <url>: Custom Jovay RPC endpoint

Set Network Config

jovay network set [options]

Options:

  • --api-key <string>: Update ZAN API key
  • --l1, --l1-rpc <url>: Update Ethereum RPC endpoint
  • --l2, --l2-rpc <url>: Update Jovay RPC endpoint

Examples

Check my wallet balance on Jovay I'll check your wallet balance on Jovay L2.
jovay wallet balance

For ERC20 token balance, use:

jovay wallet balance --token 0x<token-address>
Transfer 0.01 ETH to 0x1234...abcd I'll help you transfer 0.01 ETH. Note: amount must be in Wei (0.01 ETH = 10000000000000000 Wei).
jovay wallet transfer --amount 10000000000000000 --to 0x1234...abcd --broadcast
Call balanceOf on an ERC20 contract I'll call the balanceOf method on the ERC20 contract.
jovay contract call 
  --contract 0x<contract-address> 
  --method balanceOf 
  --inputs address 
  --outputs uint256 
  --args '"0x<wallet-address>"'
Call a contract method using ABI file I'll call the contract method using the ABI file for automatic encoding/decoding.
jovay contract call 
  --contract 0x<contract-address> 
  --method getTokenInfo 
  --abi ./path/to/abi.json 
  --args '"0x<token-address>"'
Call a contract method with complex tuple parameters I'll call the method with tuple parameters. For tuple types, wrap the values in an array.
jovay contract call 
  --contract 0x<contract-address> 
  --method processOrder 
  --inputs "address,(uint256,string)" 
  --outputs "bool" 
  --args '"0x<address>", [1000, "order-123"]'
Write to a contract to transfer tokens I'll send a transaction to transfer tokens. Remember to use `--broadcast` to actually send it.
jovay contract write 
  --contract 0x<token-address> 
  --method transfer 
  --inputs "address,uint256" 
  --args '"0x<recipient>", 1000000000000000000' 
  --broadcast
Call a payable mint function with ETH I'll call the payable mint function and send ETH with the transaction. Use `--value` to specify the amount in Wei.
jovay contract write 
  --contract 0x<nft-address> 
  --method mint 
  --inputs "uint256" 
  --args '1' 
  --value 100000000000000000 
  --broadcast

This sends 0.1 ETH (100000000000000000 Wei) to mint 1 NFT.

Preview transaction data without sending (dry run) I'll generate the encoded calldata without actually calling the contract using `--dry-run`.
jovay contract call 
  --contract 0x<contract-address> 
  --method approve 
  --inputs "address,uint256" 
  --args '"0x<spender>", 1000000' 
  --dry-run

This outputs the encoded function data that can be used in other tools or transactions.

Call a contract on Ethereum L1 instead of Jovay I'll call the contract on Ethereum (L1) instead of Jovay (L2) using the `--l1` flag.
jovay contract call 
  --contract 0x<l1-contract-address> 
  --method balanceOf 
  --inputs address 
  --outputs uint256 
  --args '"0x<wallet-address>"' 
  --l1
Write to contract with encrypted wallet I'll send a transaction using an encrypted wallet. You need to provide the encryption key with `--enc-key`.
jovay contract write 
  --contract 0x<contract-address> 
  --method setApprovalForAll 
  --inputs "address,bool" 
  --args '"0x<operator>", true' 
  --enc-key "your-encryption-password" 
  --broadcast
Get testnet tokens for development I'll request testnet ETH from the Jovay faucet (limited to once per 24 hours).

First, ensure you're on testnet:

jovay network switch --network testnet

Then request airdrop:

jovay wallet airdrop
Bridge 0.1 ETH from Ethereum to Jovay I'll help you deposit 0.1 ETH from L1 to L2. Amount must be in Wei (0.1 ETH = 100000000000000000 Wei). On testnet, if the default L2 gas limit is too low, add `--gas-limit 500000` (or higher) so the deposit passes the bridge check.
jovay bridge deposit --amount 100000000000000000 --to 0x<your-l2-address> --gas-limit 500000 --broadcast
Withdraw ETH from Jovay back to Ethereum I'll initiate an ETH withdrawal from Jovay (L2) to Ethereum (L1). Note: this is step 1 of a two-step process.

Step 1 - Initiate withdrawal on L2:

jovay bridge withdraw --amount 50000000000000000 --to 0x<your-l1-address> --broadcast

After this transaction is confirmed, wait for the batch to be finalized on L1 (up to 1 hour). Then get the proof data from the Jovay Explorer and run step 2.

Step 2 - Finalize on L1:

jovay bridge finalize-withdraw 
  --amount 50000000000000000 
  --nonce <nonce-from-SentMsg-event> 
  --msg <hex-message-from-SentMsg-event> 
  --batch-index <batch-index> 
  --proof <merkle-proof-hex> 
  --broadcast
My L1 deposit didn't arrive on L2 If the automatic deposit relay failed, you can manually claim it on L2. You'll need the message data from the `DepositETH` event log of your L1 deposit transaction.
jovay bridge claim-deposit --msg 0x<message-from-DepositETH-event> --broadcast

You can find the message data in the transaction details on an L1 block explorer (e.g., Etherscan).

Important Notes

  1. Amount units: All amounts must be in smallest unit (Wei for ETH, smallest decimal for tokens)
  2. Broadcast flag: Use --broadcast to send transactions; without it, only signed data is output
  3. L1 vs L2: Use --l1 flag to operate on Ethereum instead of Jovay
  4. Encrypted wallet: Use --enc-key when wallet is encrypted
  5. ABI files: Provide --abi for complex contract interactions, or use --inputs/--outputs for simple cases
  6. Bridge deposit --gas-limit: If L1 deposit fails with finalize deposit on Jovay, increase --gas-limit (testnet often needs 500000 or more). This also increases msg.value on L1.

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,018
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,013
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,013
Skill 文件
  • SKILL.md
    • Jovay Interaction Skill
    • Description
    • Prerequisites
    • Network information (official)
    • Instructions
      • Initial Setup
      • Wallet Operations
        • Set Wallet
        • Get Address
        • Check Balance
        • Airdrop (Testnet Only)
        • Transfer
        • Approve
      • Bridge Operations
        • Deposit ETH (L1 → L2)
        • Withdraw ETH (L2 → L1)
        • Finalize Withdraw (L1 - Step 2)
        • Claim Deposit (L2 - Manual)
      • Contract Interactions
        • Read Contract (call)
        • Write Contract (write)
        • Type Definition Examples
        • Args Format Examples
      • Transaction Operations
        • Get Transaction Info
        • Send Raw Transaction
      • Network Configuration
        • Get Network Info
        • Switch Network
        • Set Network Config
    • Examples
    • Important Notes
  • 项目或源文件

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期