sb-func-tools

Crates.iosb-func-tools
lib.rssb-func-tools
version0.1.1
sourcesrc
created_at2023-07-13 01:00:04.983923
updated_at2023-09-14 17:48:11.015153
descriptionA Rust CLI to help manage and debug your Switchboard Functions.
homepagehttps://switchboard.xyz
repositoryhttps://github.com/switchboard-xyz/sbv2-core/tree/main/rust/switchboard-common
max_upload_size
id914949
size64,711
Albert Hermida (ahermida)

documentation

README

Switchboard Logo

sb-func-tools

A Rust CLI to help manage and debug your Switchboard Functions.

Crates.io Badge

Discord Badge

Twitter Badge

Typedocs: docs.rs/sb-func-tools

Switchboard Documentation: docs.switchboard.xyz

Setup

cargo build
cargo install --path .

Commands

decode

You can pipe the last word emitted to the binary to decode the FunctionResult output.

Example

$ sb-func-tools decode -f output.json "FN_OUT: 7b2276657273696f6e223a302c2271756f7465223a5b5d2c22666e5f6b6579223a5b5d2c227369676e6572223a5b5d2c22666e5f726571756573745f6b6579223a5b5d2c22666e5f726571756573745f68617368223a5b5d2c22636861696e5f726573756c745f696e666f223a224e6f6e65227d"

{
  "version": 0,
  "quote": [],
  "fn_key": [],
  "signer": [],
  "fn_request_key": [],
  "fn_request_hash": [],
  "chain_result_info": "None"
}

Usage

Decodes a FunctionRunner result

Usage: sb-func-tools decode [OPTIONS] <FN_RESULT>

Arguments:
  <FN_RESULT>  The encoded FunctionRunner result. Should start with FN_OUT: abc...

Options:
  -f, --filepath [<FILEPATH>]  the location to write the decoded JSON result
  -h, --help                   Print help

Development

cargo run -- docker measurement gallynaut/binance-oracle:latest
Commit count: 0

cargo fmt