Open Wallet (tx.steer.fun)
Generate a link the user opens in their browser. The page shows the request, prompts them to connect their wallet, switches to the requested chainId, then executes the JSON-RPC request.
Build The Link
Base URL:
INLINECODE0
Query params:
- -
method: JSON-RPC method name. - INLINECODE2 : integer chain id to execute on (the app will switch chains before execution).
- INLINECODE3 : URL-encoded JSON (either an object or an array).
- INLINECODE4 (optional): where to redirect after success/failure with the result.
redirect_url modes:
- - Default: the app appends
resultType/result (or error) query params to redirect_url. - Template mode: if
redirect_url contains {{...}}, the app replaces placeholders instead of appending query params.
Notes:
- - If
params is a JSON array, it is treated as the exact JSON-RPC params array. - If
params is a JSON object, the app will map it to common method shapes (e.g. fill from from the connected wallet when possible). - Avoid double-encoding:
params should be encoded exactly once (e.g. encodeURIComponent(JSON.stringify(params))). If you see %2522 in the URL, it was encoded twice.
Common Flows
Sign A Message (personal_sign)
Use a JSON object:
CODEBLOCK0
Expected result: signature string.
Send A Transaction (eth_sendTransaction)
Use a JSON object (the app will set from from the connected wallet if omitted):
CODEBLOCK1
Expected result: tx hash.
Typed Data Sign (ethsignTypedDatav4)
Provide { address, typedData }:
CODEBLOCK2
Expected result: signature string.
Batch Calls (wallet_sendCalls)
Provide { calls: [{ to, data }, ...] } (and optionally from):
CODEBLOCK3
Expected result: wallet-dependent (often an id or tx hash).
Getting The Result Back
Option A: No redirect_url (manual copy)
If you omit redirect_url, the page shows a copyable response (or error) after execution.
In your message to the user, ask them to paste back:
- - the tx hash / signature string, or
- the full JSON response (if it returns an object).
Option B: redirect_url (automatic return)
If you include redirect_url, the app redirects after success or failure.
It appends query params (default mode):
-
resultType=string and
result=<value> OR
-
resultType=json and
result=<JSON.stringify(value)>
- INLINECODE28
Template mode (no bridge, good for messaging apps):
- - If
redirect_url contains {{...}}, placeholders are replaced and no query params are appended. - Placeholders:
-
{{result}}: URL-encoded result string (or URL-encoded
JSON.stringify(result))
-
{{result_raw}}: unencoded result string (or
JSON.stringify(result))
-
{{resultType}}:
string or
json
-
{{error}}: URL-encoded error message
-
{{error_raw}}: unencoded error message
Implementation note for agents:
- - Consider generating a “compose draft” deep link into your chat with the user and using that as
redirect_url so, after approval, the user lands in a pre-filled message back to you containing the result.
Example (Telegram share):
Note: Telegram's share endpoint works best when you include both url= and text=. If you omit url=, it may redirect to telegram.org instead of showing the share UI.
CODEBLOCK4
Safety Checks
- - Always show the user what the request does in plain language (what contract, what function, what chain, what value) before asking them to open the link.
- Prefer least-privilege requests; avoid requesting permissions you do not need.
打开钱包 (tx.steer.fun)
生成一个链接,用户可在浏览器中打开。该页面会显示请求内容,提示用户连接钱包,切换到请求的 chainId,然后执行 JSON-RPC 请求。
构建链接
基础 URL:
https://tx.steer.fun/
查询参数:
- - method:JSON-RPC 方法名称。
- chainId:执行操作的整数链 ID(应用会在执行前切换链)。
- params:URL 编码的 JSON(可以是对象或数组)。
- redirect_url(可选):成功或失败后携带结果重定向的地址。
redirect_url 模式:
- - 默认模式:应用会将 resultType/result(或 error)查询参数附加到 redirecturl 后。
- 模板模式:如果 redirecturl 包含 {{...}},应用会替换占位符,而不是附加查询参数。
注意:
- - 如果 params 是 JSON 数组,则将其视为精确的 JSON-RPC params 数组。
- 如果 params 是 JSON 对象,应用会将其映射为常见的方法格式(例如,尽可能从已连接钱包填充 from)。
- 避免双重编码:params 应仅编码一次(例如 encodeURIComponent(JSON.stringify(params)))。如果在 URL 中看到 %2522,说明已被编码两次。
常见流程
签名消息 (personal_sign)
使用 JSON 对象:
text
https://tx.steer.fun/?method=personal_sign&chainId=1¶ms=%7B%22message%22%3A%22hello%22%7D
预期结果:签名字符串。
发送交易 (eth_sendTransaction)
使用 JSON 对象(如果省略,应用会从已连接钱包设置 from):
text
https://tx.steer.fun/?method=eth_sendTransaction&chainId=1¶ms=%7B%22to%22%3A%220x4c5Ce72478D6Ce160cb31Dd25fe6a15DC269592D%22%2C%22data%22%3A%220xd09de08a%22%7D
预期结果:交易哈希。
类型化数据签名 (ethsignTypedDatav4)
提供 { address, typedData }:
text
https://tx.steer.fun/?method=ethsignTypedDatav4&chainId=1¶ms=%7B%22address%22%3A%220xYourAddress%22%2C%22typedData%22%3A%7B%22types%22%3A%7B%7D%2C%22domain%22%3A%7B%7D%2C%22primaryType%22%3A%22%22%2C%22message%22%3A%7B%7D%7D%7D
预期结果:签名字符串。
批量调用 (wallet_sendCalls)
提供 { calls: [{ to, data }, ...] }(可选 from):
text
https://tx.steer.fun/?method=wallet_sendCalls&chainId=1¶ms=%7B%22calls%22%3A%5B%7B%22to%22%3A%220x0000000000000000000000000000000000000000%22%2C%22data%22%3A%220x%22%7D%5D%7D
预期结果:取决于钱包(通常为 ID 或交易哈希)。
获取结果
选项 A:无 redirect_url(手动复制)
如果省略 redirect_url,页面会在执行后显示可复制的响应(或错误)。
在给用户的消息中,要求他们粘贴返回:
- - 交易哈希/签名字符串,或
- 完整的 JSON 响应(如果返回对象)。
选项 B:redirect_url(自动返回)
如果包含 redirect_url,应用会在成功或失败后重定向。
它会附加查询参数(默认模式):
- resultType=string 和 result=<值> 或
- resultType=json 和 result=
- error=<消息>
模板模式(无需桥接,适用于消息应用):
- - 如果 redirect_url 包含 {{...}},占位符会被替换,不会附加查询参数。
- 占位符:
- {{result}}:URL 编码的结果字符串(或 URL 编码的 JSON.stringify(result))
- {{result_raw}}:未编码的结果字符串(或 JSON.stringify(result))
- {{resultType}}:string 或 json
- {{error}}:URL 编码的错误消息
- {{error_raw}}:未编码的错误消息
代理实现说明:
- - 考虑生成一个指向用户聊天界面的撰写草稿深度链接,并将其用作 redirect_url,这样用户在批准后,会进入一个预先填充了结果的消息界面,方便回复给您。
示例(Telegram 分享):
注意:Telegram 的分享端点最好同时包含 url= 和 text=。如果省略 url=,可能会重定向到 telegram.org 而不是显示分享界面。
text
https://tx.steer.fun/?method=personalsign&chainId=1¶ms=%7B%22message%22%3A%22hello%22%7D&redirecturl=https%3A%2F%2Ft.me%2Fshare%2Furl%3Furl%3Dhttps%253A%252F%252Ftx.steer.fun%252F%26text%3DSignature%253A%2520%7B%7Bresult%7D%7D
安全检查
- - 在要求用户打开链接之前,始终用通俗语言向用户说明请求的具体内容(涉及哪个合约、哪个函数、哪个链、什么值)。
- 优先使用最小权限请求;避免请求不需要的权限。