JSON RPC API中SOLANA中的交易规范文档在哪里?

发布于 2025-02-08 21:36:36 字数 420 浏览 2 评论 0原文

我需要将服务器程序的交易提交到Solana区块链进行处理。

我的程序不是JavaScript,因此,我无法使用Web3J。

我使用JSON RPC API sendtransaction: https://docs.solana comle SendTransaction

我需要在程序中构建交易。

各种类型的交易规范的文档在哪里,例如。转移,批准,撤销等?

例如。 如何形成“转移”交易?这是什么规格?需要哪些参数及其名称和类型?

此致, configentia

I need to submit transactions from a server program to Solana blockchain for processing.

My programs is not JavaScript, therefore, I cannot use web3js.

I use the JSON RPC API sendTransaction:
https://docs.solana.com/developing/clients/jsonrpc-api#sendtransaction

I need to form the transaction in the program.

Where is the documentation for transaction specification for various types, eg. transfer, approve, revoke, etc?

Eg.
How do I form a "transfer" transaction? What's the spec for that? What parameters are required and their names and types?

Best regards,
Configentia

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冷默言语 2025-02-15 21:36:36

您必须首先使用传输说明然后将其编码为字符串并在sendtransaction中发送它,

curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
  {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "sendTransaction",
    "params": [
      "4hXTCkRzt9WyecNzV1XPgCDfGAZzQKNxLXgynz5QDuWWPSAZBZSHptvWRL3BjCvzUXRdKvHL2b7yGrRQcWyaqsaBCncVG7BFggS8w9snUts67BSh3EqKpXLUm5UMHfD7ZBe9GhARjbNQMLJ1QD3Spr6oMTBU6EhdB4RD8CP2xUxr2u3d6fos36PD98XS6oX8TQjLpsMwncs5DAMiD4nNnR8NBfyghGCWvCVifVwvA8B8TJxE1aiyiv2L429BCWfyzAme5sZW8rDb14NeCQHhZbtNqfXhcp2tAnaAT"
    ]
  }

我不确定如何在没有solana软件包的情况下在本地创建签名的交易,也许您可​​以,但是它会更难/TS,Golang,Java,Rust,C ++

You have to create a signed transaction locally first using the transfer instruction then encode it as a string and send it in sendTransaction

curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
  {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "sendTransaction",
    "params": [
      "4hXTCkRzt9WyecNzV1XPgCDfGAZzQKNxLXgynz5QDuWWPSAZBZSHptvWRL3BjCvzUXRdKvHL2b7yGrRQcWyaqsaBCncVG7BFggS8w9snUts67BSh3EqKpXLUm5UMHfD7ZBe9GhARjbNQMLJ1QD3Spr6oMTBU6EhdB4RD8CP2xUxr2u3d6fos36PD98XS6oX8TQjLpsMwncs5DAMiD4nNnR8NBfyghGCWvCVifVwvA8B8TJxE1aiyiv2L429BCWfyzAme5sZW8rDb14NeCQHhZbtNqfXhcp2tAnaAT"
    ]
  }

I'm not sure how you can create a signed transaction locally without a solana package, maybe you can but it would be a lot harder, solana has sdks for python, js/ts, golang, java, rust, c++

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文