```rust use substratestellarsdk::{ horizon::Horizon, network::TEST_NETWORK, Asset, IntoSecretKey, Memo, MilliSecondEpochTime, MuxedAccount, Operation, Price, PublicKey as StellarPublicKey, SecondEpochTime, StroopAmount, TimeBounds, Transaction, TransactionEnvelope, XdrCodec, };
const ACCOUNTID1: &str = "GDGRDTRINPF66FNC47H22NY6BNWMCD5Q4XZTVA2KG7PFZ64WHRIU62TQ"; const ACCOUNTID2: &str = "GBNKQVTFRP25TIQRODMU5GJGSXDKHCEUDN7LNMOS5PNM427LMR77NV4M"; const ACCOUNT_ID3: &str = "GCACWDM2VEYTXGUI3CUYLBJ453IBEPQ3XEJKA772ARAP5XDQ4NMGFZGJ";
const SIGNER1: &str = "SCVKZEONBSU3XD6OTHXGAP6BTEWHOU4RPZQZJJ5AVAGPXUZ5A4D7MU6S"; const SIGNER3: &str = "SDOKV37I4TI655LMEMDQFOWESJ3LK6DDFKIVTYKN4YYTSAYFIBPP7MYI";
// Step 1: instantiate horizon server let horizon = Horizon::new("https://horizon-testnet.stellar.org");
// Step 2: fetch next sequence number of account let nextsequencenumber = horizon .fetchnextsequencenumber(ACCOUNTID1, 10_000) .unwrap();
debug::info!("Sequence number: {}", nextsequencenumber);
// Step 3: build transaction let mut transaction = Transaction::new( ACCOUNTID1, nextsequencenumber, Some(2 * 321), Some(TimeBounds::fromtimepoints( SecondEpochTime(162620000), MilliSecondEpochTime(1667257200000), )), Some(Memo::fromtext_memo("Hello World!").unwrap()), ) .unwrap();
// Step 4: add operations transaction .appendoperation( Operation::newpayment( Some(ACCOUNTID3), ACCOUNTID2, Asset::fromassetcode("USD", ACCOUNTID3).unwrap(), StroopAmount(1234560000), ) .unwrap(), ) .unwrap();
transaction .appendoperation( Operation::newmanageselloffer( None::<&str>, Asset::fromassetcode("DOMINATION", ACCOUNTID2).unwrap(), Asset::native(), "152.103", Price::fromfloat(4.58).unwrap(), Some(1742764), ) .unwrap(), ) .unwrap();
// Step 5: transform into transaction envelope and sign let mut envelope = transaction.intotransactionenvelope(); envelope .sign( &TESTNETWORK, vec![ &SIGNER1.intosecretkey().unwrap(), &SIGNER3.intosecret_key().unwrap(), ], ) .unwrap();
// Step 6: submit transaction let submissionresponse = horizon.submittransaction(&envelope, 60000, true); debug::info!("Response: {:?}", submissionresponse); ```