Questions tagged [serialization]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
47 views

How to deserialize a Magic Link's versioned transaction?

Getting the following error when trying to send a signed transaction with Magic Link. WalletSignTransactionError: Versioned messages must be deserialized with VersionedMessage.deserialize() Magic's ...
Hyetigran's user avatar
  • 197
0 votes
1 answer
29 views

Serialising/deserialising data on android

I am currently going though the Solana development course and I try to adapt what I learn onto an Android application. Everything is going great so far but now I am stuck when I try to serialise/...
xapgo's user avatar
  • 1
1 vote
1 answer
79 views

What's the difference of using Borsh and buffer layout to encode/decode?

I want to interact with a program and discover this website: https://bettercallsol.dev/ Basically it allows you to serialize the data using both Borsh & Buffer layout. Despite they are two ...
johnhckuo's user avatar
  • 135
1 vote
1 answer
223 views

How to properly deserialize encoded transaction?

// Sign the transaction const feePayer = USER_KEYPAIR; const deserializedTx = Transaction.from(Buffer.from(swapTransaction, 'base64')); deserializedTx.partialSign(feePayer); const ...
omm's user avatar
  • 27
1 vote
1 answer
222 views

"Signature verification failed" error after signing transaction on the client using Phantom

I'm building a transaction on the server using Solnet: var newTransaction = new Transaction(); newTransaction.RecentBlockHash = blockHash.Result.Value.Blockhash; newTransaction.FeePayer = vaultAccount;...
Keith Walton's user avatar
0 votes
2 answers
563 views

Offline Transaction: Transaction signature verification failure?

we are recently been having some issues with our transactions on Solana. We serialize the transaction, send it to the user, deserialize it, make the user sign, extract the signature, send back the ...
Jinspe's user avatar
  • 3
3 votes
2 answers
949 views

Is there a way to estimate the transaction size?

Currently to get the size of a transaction I have to do the following const tx = new Transaction().add(...) const { blockhash } = await connection.getLatestBlockhash(); tx.recentBlockhash = blockhash; ...
lameren's user avatar
  • 133
1 vote
1 answer
72 views

What does range full operator do in borsh serialize?

I follow hackernoon-solana to see the syntax in non anchor project. this is the function signature pub fn process_instruction(program_id:&Pubkey,accounts:&[AccountInfo],input:&[u8])->...
Yilmaz's user avatar
  • 1,071
4 votes
1 answer
178 views

Cannot serialize V0 Txs appropriately

I am trying to use connection.sendEncodedTransaction() to send a signed Tx encoded to base64 like this: const base64Tx = signedTransaction.serialize().toString('base64'); console.log('encodedTx:', ...
Sparker73's user avatar
  • 143
3 votes
1 answer
104 views

Recommended serialization library for dynamically sized objects

I am trying to write a vector of objects into a solana account. The problem is, the pre-allocated size of the account might be too small for my vector. I know i can re-size the account with realloc, ...
Ripleys 0x's user avatar
1 vote
1 answer
97 views

Serialize float, int, Pubkey data using web3 js

I am trying to pass parameters of types: float, int, bool, pubkey to Solana anchor program instructions from web3js library #[account] pub struct Parent { pub field1: String, pub field2: u8, ...
Vivek's user avatar
  • 121
0 votes
1 answer
535 views

Serialize custom struct type defined in Solana anchor program from JS

I have the following struct defined in the Solana anchor program #[account] pub struct Parent { pub field1: String, pub data_arr: Vec<Data>, } #[derive(Debug, Clone, AnchorSerialize, ...
Vivek's user avatar
  • 121
6 votes
1 answer
359 views

How to serialize instruction buffer for an Anchor program

Given the following Anchor instruction : pub fn create_joke(ctx: Context<CreateJokeCtx>, joke_content: String) -> ProgramResult { ... } How to find the borsch schema and serialize the ...
mwrites's user avatar
  • 417
2 votes
1 answer
66 views

Is it possible to use type `char` in an account field / as funciton arguments?

The goal is to use to use the char type. I couldn't find a way or ressource on how to solve to borsh serialization errors that get thrown when trying to store a char type in an #[account] struct field....
tenxsoydev's user avatar
4 votes
3 answers
297 views

Program cannot deserialize borsch serialized instruction from typescript client

I am trying to write a client code in typescript for a contract written in vanilla rust. I am unable to serialize an instruction such that it can be deserialized by the program #[derive(Debug, ...
chinepun.sol's user avatar