All Questions
Tagged with vec solana-program
4 questions
1
vote
2
answers
35
views
How to Calculate Space for PDA Accounts with Dynamic Vectors in Solana?
I am working on a NFT staking program. I need to create a PDA account with a structure that includes a dynamic Vec.
Here's the structure:
#[account]
pub struct UserNftStakeAccount {
pub user: ...
1
vote
1
answer
42
views
In solana anchor, how to use max_len macro to define multi-dimensional vector?
I'm using anchor to build solana program.
In account struct, I have multi-dimensional vector.
#[max_len(2,50)]
element: Vec<Vec<MyType>>,
In this case, what is the meaning of (2, 50)?
I ...
1
vote
1
answer
143
views
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 : ...
2
votes
1
answer
588
views
how to delete an element in a Vector Struct at Rust Anchor
Vec remove method
{
"publicKey": "8bu8S247Z1mcQnkWqNVLrU3L2VwWQ4hg2sEyjK4a9oiG",
"account": {
"adminKey": "BUa8iJi3PzkKDgDreyc4NG3BruYCTqmiRjPg1g8p2jHz&...