Pass string to entry function?

how can I pass a string from sui cli to this function?

public entry fun foo<Bar: copy + drop + store>(
        bar: Bar,
        ctx: &mut TxContext,
    ) { ... }

This doesn’t work.

    sui client call \
             --module foo \
             --package $PKD_ID \
             --function foo \
             --type-args "std::string::String"  \
             --args "\"bar\"" \
             --gas-budget 100000000 \
1 Like

I figured out, use std::vector<u8>, next question how can I pass std::vector<u8> as type arg in sui cli?

1 Like

Probably you figured it out already, but you can pass it like this:
--type-args "vector<u8>"

1 Like