Sending vector of string as function parameter

I am getting an error passing vector of string as function parameter…is that not allowed on move?

Error executing ExecutionError: ExecutionError { inner: ExecutionErrorInner 
{ kind: SuiMoveVerificationError, source: Some("Invalid entry point 
parameter  type. Expected primitive or object type. Got: &mut 
vector<0x1::string::String>"), command: None } }

If it is, how to resolve this error?

1 Like

You would need to pass the strings as vector<u8> inputs to the transaction, and then within the PTB, call 0x1::string::utf8 to create an instance of 0x1::string::String from them.

Then you can call MakeMoveVec on all the resulting strings to get a string, and finally you can call the function in question, passing in that vector of strings

1 Like