Questions tagged [vec]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer

Nested vector in PDA account not being properly serialized

I am creating a PDA account that stores a string and a vector. Inside this vector, there is another vector. This is the structure of my account: #[account] pub struct Monster { pub seed : ...
0xNicko's user avatar
  • 21
2 votes
1 answer

how to delete an element in a Vector Struct at Rust Anchor

Vec remove method { "publicKey": "8bu8S247Z1mcQnkWqNVLrU3L2VwWQ4hg2sEyjK4a9oiG", "account": { "adminKey": "BUa8iJi3PzkKDgDreyc4NG3BruYCTqmiRjPg1g8p2jHz&...
Mojo's user avatar
  • 149
5 votes
1 answer

Getting an IDLError when I try to create a vector of a defined Struct

I currently have defined a Ship struct in my backend code, as well as a Port struct which contains an attribute ships_berthed that is of type Vec. However, on my frontend (Svelte), when I try to call ...
Aengus's user avatar
  • 147
1 vote
1 answer

Iterate through Vec data and modify a field

I have the following code. Its a loop of an account's stored Vec that have an address and a number on it structure. Inside the loop, if a vec's address is the payer addres, then I want to substract 1 ...
user3688985's user avatar