Skip to main content

Questions tagged [serialization]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
17 views

What is account serialize and deserialize?

I was going through the anchor documentation and got to the tic tac toe game. Now having a hard time understanding why we need account serialize and deserialize here. pub enum GameState { Active, ...
Anas's user avatar
  • 41
0 votes
1 answer
150 views

Jupiter v6 Transaction Serialization Failing

I am following along the Jupiter v6 docs to implement the Swap API. I am successfully getting the Quote Response from the v6/quote endpoint. After that I am trying to get the serialized transactions ...
Anish Mukherjee's user avatar
0 votes
1 answer
69 views

borsh.serialize is not a function

class Initialize1 { constructor({ nonce, openTime }) { this.nonce = nonce; this.openTime = openTime; } static schema = new Map([ [ Initialize1, { kind: "...
Roomka's user avatar
  • 47
1 vote
1 answer
125 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
48 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
188 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
  • 137
1 vote
1 answer
693 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
399 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
898 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
4 votes
2 answers
2k 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
  • 153
1 vote
1 answer
83 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,164
4 votes
1 answer
397 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
158 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
122 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
692 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
545 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
  • 427
2 votes
1 answer
72 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
366 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