1.0.4 • Published 2 years ago

solana-tx-serialize v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 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

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago