/* This third approach is nearly identical to the second. The only difference is here I define an empty public key as the public key created from the empty string. In order to make this work, I had to make one change to the js stellar sdk codebase. In the keypair.js file, I added a case to the fromPublicKey method that accepts "" and returns a keypair generated from the "00000000000000000000000000000000" string. This adds three lines of code. */ // 1. build the partial transaction (excludes the source account and sequence numbers // Define an empty address const emptyAddress_a3 = s.Keypair.fromPublicKey("").publicKey(); // Define an account const account_a3 = new s.Account(emptyAddress_a3, "0"); // Define a transaction object let tx_a3 = new s.TransactionBuilder(account_a3); // Add payment operation tx_a3.addOperation(s.Operation.payment({ destination: "GASIA4ZTLZEF4TRLLDQCQIT43KNZKSAEU3PX3BQVNEZVNJ4FM7LBIPTK", asset: s.Asset.native(), amount: "1", })) // Add a memo if included (Optional) // tx_a2.addMemo(s.Memo.text("SEP, SEP 007")); // 2. Convert to a transaction envelope tx_a3 = tx_a3.build().toEnvelope(); // 3. Convert to Base64 tx_a3 = tx_a3.toXDR('base64'); // 4. Url encode (Optional) const url_a3 = encodeURIComponent(tx_a3); // 5. Print out ("web+stellar:tx?xdr=" + urlEncoded) (Optional) // console.log(`web+stellar:tx?xdr=${url_a3}`); /* Result: web+stellar:tx?xdr=AAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAZAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAJIBzM15IXk4rWOAoInzam5VIBKbffYYVaTNWp4Vn1hQAAAAAAAAAAACYloAAAAAAAAAAAA%3D%3D */