1.0.4 • Published 3 years ago

solana-tx-serialize v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

solana-tx-serialize

Serialize Solana web3.Transaction objects to bs58 and back

Install

yarn add solana-tx-serialize
npm install solana-tx-serialize

Example

const pk = Keypair.generate();
const inst = SystemProgram.createAccount({
	fromPubkey: pk.publicKey,
	newAccountPubkey: pk.publicKey,
	lamports: 0,
	space: 0,
	programId: SystemProgram.programId,
});

const tx = new Transaction();
tx.add(inst);
tx.recentBlockhash = Keypair.generate().publicKey.toBase58();
tx.feePayer = pk.publicKey;
tx.sign(pk);

const bs58string = bs58Transaction(tx);
console.log(bs58string);

const decodedTx = unbs58Transaction(bs58string);
console.log(decodedTx);
1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago