Description

Operations are individual commands that modify the ledger.

pub struct Operation {
    pub source_account:Option<MuxedAccount>,
    pub body:OperationBody,
}

Operations List

All the Possible operations are listed in https://github.com/stellar/rs-stellar-xdr with the inclusion of the ‘next’ feature of the crate.

// Ref: <https://docs.rs/stellar-xdr/0.0.17/stellar_xdr/next/enum.OperationBody.html>
pub enum OperationBody {
    CreateAccount(CreateAccountOp),
    Payment(PaymentOp),
    PathPaymentStrictReceive(PathPaymentStrictReceiveOp),
    ManageSellOffer(ManageSellOfferOp),
    CreatePassiveSellOffer(CreatePassiveSellOfferOp),
    SetOptions(SetOptionsOp),
    ChangeTrust(ChangeTrustOp),
    AllowTrust(AllowTrustOp),
    AccountMerge(MuxedAccount),
    Inflation,
    ManageData(ManageDataOp),
    BumpSequence(BumpSequenceOp),
    ManageBuyOffer(ManageBuyOfferOp),
    PathPaymentStrictSend(PathPaymentStrictSendOp),
    CreateClaimableBalance(CreateClaimableBalanceOp),
    ClaimClaimableBalance(ClaimClaimableBalanceOp),
    BeginSponsoringFutureReserves(BeginSponsoringFutureReservesOp),
    EndSponsoringFutureReserves,
    RevokeSponsorship(RevokeSponsorshipOp),
    Clawback(ClawbackOp),
    ClawbackClaimableBalance(ClawbackClaimableBalanceOp),
    SetTrustLineFlags(SetTrustLineFlagsOp),
    LiquidityPoolDeposit(LiquidityPoolDepositOp),
    LiquidityPoolWithdraw(LiquidityPoolWithdrawOp),
    InvokeHostFunction(InvokeHostFunctionOp),
    BumpFootprintExpiration(BumpFootprintExpirationOp),
    RestoreFootprint(RestoreFootprintOp),
}

Need to only create wrapper functions around this operation variants to be able to initialize them properly. The way I have implemented here for the CreateAccount operation.

https://github.com/rahul-soshte/rs-stellar-base/blob/main/src/operations/create_account.rs