1 个不稳定版本
0.5.0 | 2024年5月12日 |
---|
#37 在 #balance
185KB
4.5K SLoC
Bundlr Rust SDK
使用 Rust 与 Bundlr 网络交互的 SDK。
示例
代码示例可在 examples
目录中找到
客户端
要使用客户端二进制文件,您必须使用以下方式构建它
cargo build --release --features="build-binary"
客户端二进制文件将在 target/release/cli
生成。然后,您可以使用以下命令执行该二进制文件:./cli --help
USAGE:
cli <SUBCOMMAND>
OPTIONS:
-h, --help Print help information
SUBCOMMANDS:
balance Gets the specified user's balance for the current Bundlr node
fund Funds your account with the specified amount of atomic units
help Print this message or the help of the given subcommand(s)
price Check how much of a specific currency is required for an upload of <amount>
bytes
upload Uploads a specified file
upload-dir Uploads a folder (with a manifest)
withdraw Sends a fund withdrawal request
示例
./cli balance <address> --host <host> --currency <currency>
./cli price <bytes> --host <host> --currency <currency>
./cli fund <amount> --host <host> --currency <currency> --wallet <path | private_key>
./cli withdraw <amount> --host <host> --currency <currency> --wallet <path | private_key>
./cli upload <file> --host <host> --currency <currency> --wallet <path | private_key>
路线图
一些功能仍在开发中。如果您需要使用其中之一,您可能想查看 js-sdk,或在存储库中打开一个问题。
项目 | Arweave | Solana | Ethereum | ERC20 | Cosmos | Aptos |
---|---|---|---|---|---|---|
Balance | [x] | [x] | [x] | [ ] | [ ] | [ ] |
价格 | [x] | [x] | [x] | [ ] | [ ] | [ ] |
基金 | [x] | [ ] | [ ] | [ ] | [ ] | [ ] |
提款 | [x] | [ ] | [ ] | [ ] | [ ] | [ ] |
上传 | [x] | [x] | [x] | [ ] | [ ] | [ ] |
上传目录 | [ ] | [ ] | [ ] | [ ] | [ ] | [ ] |
验证包 | [x] | [x] | [x] | [x] | [x] | [x] |
测试
为了正确运行测试,您需要生成随机包。运行
npm install
npm run generate-bundles
在 res/gen_bundles
中生成随机包,然后运行
cargo test
依赖项
~22–39MB
~688K SLoC